正如标题所述,我正在寻找一种方法让VBScript计算计算机上的NIC数量并返回它们的信息。至少我想获得NIC的数量。
答案 0 :(得分:0)
查询WMI:
Dim wmi, items, item, count
Set wmi = GetObject("winmgmts:\\.\root\CIMV2")
Set items = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapter")
count = 0
For Each item in items
Wscript.Echo "Name: " & item.Name
count = count + 1
Next
Wscript.Echo "Count: " & count