10-31-2016, 08:31 AM
Hi Gintaras, hi all
According to MSDN,
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_TapeDrive")
Wscript.Echo colItems.Count
So when using this code:
IDispatch wmi._getfile("winmgmts:")
IDispatch col = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapter WHERE PhysicalAdapter = TRUE AND ConfigManagerErrorCode =22" @ wbemFlagReturnImmediately|wbemFlagForwardOnly))
why
_i=col.Count
does produce a exception????
_i should be 4 on my computer.
TY
According to MSDN,
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_TapeDrive")
Wscript.Echo colItems.Count
So when using this code:
IDispatch wmi._getfile("winmgmts:")
IDispatch col = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapter WHERE PhysicalAdapter = TRUE AND ConfigManagerErrorCode =22" @ wbemFlagReturnImmediately|wbemFlagForwardOnly))
why
_i=col.Count
does produce a exception????
_i should be 4 on my computer.
TY