Windows batch command to display all network connections?

10,182

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.

Share:
10,182

Related videos on Youtube

Ken Paul
Author by

Ken Paul

Updated on September 17, 2022

Comments

  • Ken Paul
    Ken Paul over 1 year

    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.

    • RohitS
      RohitS over 14 years
      What "connections"? Maybe clarify? Physical? Logical? ipconfig /all displays physical, while netstat -a will display logical port connections.
  • Ken Paul
    Ken Paul over 14 years
    Nope. At the moment, Network Connections shows 1 Internet Connection, 5 LAN connections, and 1 VPN connection. ipconfig /all shows only the 3 connections that are actively connected.
  • Ken Paul
    Ken Paul over 14 years
    netsh shows almost everything, but not the VPN connection.
  • dolmen
    dolmen about 13 years
    The link does not apply anymore. :(
  • harrymc
    harrymc about 13 years
    @dolmen: It worked for me just now.
  • Neeraj
    Neeraj about 5 years
    @harrymc That link seems to be broken. Can you please (if possible) post the script here? Or are you aware of any other solution(s) by now?
  • harrymc
    harrymc about 5 years
    @baburao: Link replaced from the Wayback Machine and script copied into the answer. Remember that this is a very old post and answer.