Using VBS to enumerate the code _vbs of network Connections

Source: Internet
Author: User

Describe

Retrieves information about all active network connections on the computer.

For more information about the Win32_networkconnection categories used in this code, click here.

Support Platform

Windows Server 2003

Is

Windows XP

Is

Windows 2000

Is

Windows NT 4.0

Yes, with WMI installed


Scripting code
Copy Code code as follows:

On Error Resume Next
StrComputer = "."
Set objWMIService = GetObject ("winmgmts:\\" & StrComputer & "\root\cimv2")
Set colitems = objWMIService.ExecQuery ("SELECT * from Win32_networkconnection")
For each objitem in colitems
WScript.Echo "Access Mask:" & Objitem.accessmask
WScript.Echo "Caption:" & objitem.caption
WScript.Echo "Connection State:" & Objitem.connectionstate
WScript.Echo "Connection Type:" & Objitem.connectiontype
WScript.Echo "Description:" & objitem.description
WScript.Echo "Display Type:" & Objitem.displaytype
WScript.Echo "Local Name:" & Objitem.localname
WScript.Echo "Name:" & objItem.Name
WScript.Echo "Persistent:" & Objitem.persistent
WScript.Echo "Provider Name:" & Objitem.providername
WScript.Echo "Remote Name:" & Objitem.remotename
WScript.Echo "Remote Path:" & Objitem.remotepath
WScript.Echo "Resource Type:" & Objitem.resourcetype
WScript.Echo "User Name:" & Objitem.username
WScript.Echo
Next

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.