' ===----( * )----=== _ - _ --==-- _ - _ ===----( * )----=== ' ' _ - - - ~ ~ ~ .. ~ ~ ~ - - - _ _ ' ' HWList.vbs script by Dzmitry Stremkouski ( http://mitroko.com ) 2008 ' ' - _ _ _ _ - .--. - _ _ _ _ - - ' ' ===--( * )--=== ~ _ - /\\/\\ - _ ~ ===--( * )--=== ' ' ===--=== ===------=== . \\/\\/ . ===------=== ===--=== ' Option explicit '.\ '::' /.' ticilpxe noitpO ' - \ `` / - ' ' F R E E D O M \/ M O D E E R F ' GPLv2. ' / \ ' ===== '8 8` Dim objWMIService, colItems, objItem, netItems, objnetItem, k Dim obArgs Set obArgs = WScript.Arguments Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", &h30) For Each objItem In colItems If (Instr(1, LCASE(objItem.PNPDeviceID), LCASE("PCI\")) = 1) or (Instr(1, LCASE(objItem.PNPDeviceID), LCASE("USB\")) = 1) Then Set netItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration Where Caption = """ & objItem.Caption & """ ") If obArgs.Count = 0 Then For Each objnetItem In netItems If (objItem.Caption = objnetItem.Caption) Then For k = 0 to 9 If Instr(1,objItem.PNPDeviceID, "\" & k) <> 0 Then WScript.Echo objItem.NetConnectionID & ":" & Mid(objItem.PNPDeviceID, 1, Instr(1,objItem.PNPDeviceID, "\" & k) - 1) End If Next End If Next Else If objItem.NetConnectionID = obArgs.Item(0) Then For Each objnetItem In netItems If (objItem.Caption = objnetItem.Caption) Then For k = 0 to 9 If Instr(1,objItem.PNPDeviceID, "\" & k) <> 0 Then WScript.Echo Mid(objItem.PNPDeviceID, 1, Instr(1,objItem.PNPDeviceID, "\" & k) - 1) End If Next End If Next End If End If Set netItems = Nothing End If Next Set colItems = Nothing Set objWMIService = Nothing