Windows batch command to display all network connections?

1

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.

Ken Paul

Posted 2009-10-28T18:50:24.290

Reputation: 133

What "connections"? Maybe clarify? Physical? Logical? ipconfig /all displays physical, while netstat -a will display logical port connections. – AdminAlive – 2009-10-28T18:57:50.017

Answers

3

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.

harrymc

Posted 2009-10-28T18:50:24.290

Reputation: 306 093

@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? – baburao – 2019-03-13T21:12:55.083

@baburao: Link replaced from the Wayback Machine and script copied into the answer. Remember that this is a very old post and answer. – harrymc – 2019-03-14T07:43:48.537

The link does not apply anymore. :( – dolmen – 2011-03-26T16:03:53.870

@dolmen: It worked for me just now. – harrymc – 2011-03-26T16:46:43.957

Nice find. On my machine, it only shows: ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\::{21EC2020-3AEA-1069-A2DD-08002B30309 }\::{7007ACC7-3202-11D1-AAD2-00805FC1270E} Local Area Connection, which is 2 less than netsh, but I don't have any disconnected connections to try it on. – DaveParillo – 2009-10-28T19:40:58.570

0

Maybe this from a batch file?

NetSh Interface httpstunnel Show Interfaces
NetSh Interface IPv4 Show Interfaces
NetSh Interface IPv6 Show Interfaces

cyberponk

Posted 2009-10-28T18:50:24.290

Reputation: 171

0

Using ipconfig /all doesn't list your disconnected devices?

Update

You might try netsh - it's an interactive program. Type netsh. At the prompt try:

> interface show interface

> bye   (or quit)

I don't have a disconnected interface my self to try this on, sorry in advance.

DaveParillo

Posted 2009-10-28T18:50:24.290

Reputation: 13 402

I believe he wants to include things like dialup connections, 1394 connections, and other non-TCP/IP connections. – eleven81 – 2009-10-28T19:01:25.703

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 – 2009-10-28T19:04:17.210

netsh shows almost everything, but not the VPN connection. – Ken Paul – 2009-10-28T19:53:31.137