Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Enumerate all network connections

Reply
 
Old 05-14-2009   #1 (permalink)
Jake


 
 

Enumerate all network connections

Hi,

If I rightclick on XP's Network Neighborhood and select Properties I get
a new window with all the computer's network connections displayed.

How can I enumerate these connections in a list and check whether each
is active / deactivated and connected / disconnected?

Thanks a lot for examples on how to do that

regards

jake

My System SpecsSystem Spec
Old 05-14-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: Enumerate all network connections


"Jake" <jake56@xxxxxx> wrote in message
news:uAxBwtN1JHA.6056@xxxxxx
Quote:

> Hi,
>
> If I rightclick on XP's Network Neighborhood and select Properties I get a
> new window with all the computer's network connections displayed.
>
> How can I enumerate these connections in a list and check whether each is
> active / deactivated and connected / disconnected?
>
> Thanks a lot for examples on how to do that
>
> regards
>
> jake
It isn't VB Script but it's exceedingly simple:

net.exe use


My System SpecsSystem Spec
Old 05-15-2009   #3 (permalink)
Jake


 
 

Re: Enumerate all network connections

Pegasus [MVP] wrote:
Quote:

> "Jake" <jake56@xxxxxx> wrote in message
> news:uAxBwtN1JHA.6056@xxxxxx
Quote:

>> Hi,
>>
>> If I rightclick on XP's Network Neighborhood and select Properties I get a
>> new window with all the computer's network connections displayed.
>>
>> How can I enumerate these connections in a list and check whether each is
>> active / deactivated and connected / disconnected?
>>
>> Thanks a lot for examples on how to do that
>>
>> regards
>>
>> jake
>
> It isn't VB Script but it's exceedingly simple:
>
> net.exe use
>
>
Pegasus,

Thanks but when I did that I got a list of all the drive mappings, not
all the network *adapters* as displayed under Network
Neigborhood/Properties.

No other 'net' parameter seemed to give me that either.

Any other clues?

regards jake
My System SpecsSystem Spec
Old 05-15-2009   #4 (permalink)
T Lavedas


 
 

Re: Enumerate all network connections

On May 15, 2:09*am, Jake <jak...@xxxxxx> wrote:
Quote:

> Pegasus [MVP] wrote:
Quote:

> > "Jake" <jak...@xxxxxx> wrote in message
> >news:uAxBwtN1JHA.6056@xxxxxx
Quote:

> >> Hi,
>
Quote:
Quote:

> >> If I rightclick on XP's Network Neighborhood and select Properties I get a
> >> new window with all the computer's network connections displayed.
>
Quote:
Quote:

> >> How can I enumerate these connections in a list and check whether eachis
> >> active / deactivated and connected / disconnected?
>
Quote:
Quote:

> >> Thanks a lot for examples on how to do that
>
Quote:
Quote:

> >> regards
>
Quote:
Quote:

> >> jake
>
Quote:

> > It isn't VB Script but it's exceedingly simple:
>
Quote:

> > net.exe use
>
> Pegasus,
>
> Thanks but when I did that I got a list of all the drive mappings, not
> all the network *adapters* as displayed under Network
> Neigborhood/Properties.
>
> No other 'net' parameter seemed to give me that either.
>
> Any other clues?
>
> regards jake
Again, at the command prompt, try ...

ipconfig /all

Or in script (from the MS TechNet Script Center's samples) ...

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_NetworkAdapter",,48)
For Each objItem in colItems
Wscript.Echo "Adapter Type: " & objItem.AdapterType

Select Case objItem.AdapterTypeID
Case 0 strAdapterType = "Ethernet 802.3"
Case 1 strAdapterType = "Token Ring 802.5"
Case 2 strAdapterType = "Fiber Distributed Data Interface
(FDDI)"
Case 3 strAdapterType = "Wide Area Network (WAN)"
Case 4 strAdapterType = "LocalTalk"
Case 5 strAdapterType = "Ethernet using DIX header format"
Case 6 strAdapterType = "ARCNET"
Case 7 strAdapterType = "ARCNET (878.2)"
Case 8 strAdapterType = "ATM"
Case 9 strAdapterType = "Wireless"
Case 10 strAdapterType = "Infrared Wireless"
Case 11 strAdapterType = "Bpc"
Case 12 strAdapterType = "CoWan"
Case 13 strAdapterType = "1394"
End Select

Wscript.Echo "Adapter Type Id: " & strAdapterType
Wscript.Echo "AutoSense: " & objItem.AutoSense
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device ID: " & objItem.DeviceID
Wscript.Echo "Index: " & objItem.Index
Wscript.Echo "MAC Address: " & objItem.MACAddress
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Maximum Number Controlled: " &
objItem.MaxNumberControlled
Wscript.Echo "Maximum Speed: " & objItem.MaxSpeed
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Net Connection ID: " & objItem.NetConnectionID
Wscript.Echo "Net Connection Status: " &
objItem.NetConnectionStatus
For Each strNetworkAddress in objItem.NetworkAddresses
Wscript.Echo "NetworkAddress: " & strNetworkAddress
Next
Wscript.Echo "Permanent Address: " & objItem.PermanentAddress
Wscript.Echo "PNP Device ID: " & objItem.PNPDeviceID
Wscript.Echo "Product Name: " & objItem.ProductName
Wscript.Echo "Service Name: " & objItem.ServiceName
Wscript.Echo "Speed: " & objItem.Speed
Next

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
network connections gone?! Vista General
Browse (enumerate) computers on the network (like Explorer does) PowerShell
Network Connections disappeared in Network sharing center Vista networking & sharing
Network Connections Vista networking & sharing
Network Connections Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46