Windows batch command to display all network connections

batch filenetworkingwindows

What Windows (preferably XP) batch command will list all of the network connections that appear in the Network Connections dialog? I've tried RASDIAL, IPCONFIG, NETSTAT, and NET commands with various option combinations, but they only seem to show those that are actually connected. I want to see the ones not connected as well.

CLARIFICATION: I want to be able to see dialups, wireless, firewire, LAN, miniport, VPN, etc. connections whether connected, disconnected, disabled, etc. just like in the Network Connections dialog.

Best Answer

See this Windows script : List Items in the Network Connections Folder:

Const NETWORK_CONNECTIONS = &H31;&

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(NETWORK_CONNECTIONS)
Set objFolderItem = objFolder.Self
Wscript.Echo objFolderItem.Path

Set colItems = objFolder.Items
For Each objItem in colItems
    Wscript.Echo objItem.Name
Next

Description: Reports the path to the Network Connections folder, and then lists any items found in that folder. For Windows NT 4.0 and Windows 98, this script requires Windows Script Host 5.1 and Internet Explorer 4.0 or later.

Related Question