小弟刚学习vbs入门,下面是我写的枚举网卡的代码 , 结果需要统计域内所有机器的网卡信息 到一张表上,需要用什么语句实现?
On Error Resume Next
strComputer = "."
Set WSHNetwork = WScript.CreateObject("WScript.Network")
ComputerName = WSHNetwork.ComputerName
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TempFile = FSO.CreateTextFile(TempFiles)
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
n = 0
For Each objAdapter In colAdapters
for each Objaddress in objAdapter.IPaddress
n = n + 1
a = WSHNetwork.ComputerName
b= b & objaddress
c = c & objAdapter.Description
d = d & objAdapter.MACAddress
Next
next