10-31-2016, 10:28 AM
reviving this...
example using Win32_NetworkAdapterConfiguration
code used:
IDispatch wmi._getfile("winmgmts:")
IDispatch col = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True" @ wbemFlagReturnImmediately|wbemFlagForwardOnly)
IDispatch x
foreach x col
out "----"
VARIANT v=x.ArpAlwaysSourceRoute
out F"0x{v.vt}"
OutVariantType(v)
how to deal when :
1. variable is boolean like boolean ArpAlwaysSourceRoute
0x1
VARIANT type: VT_NULL
QM type:
note: means there is no data
does not work either with int (QM does not seems to hoeld a boolean type)
2.
IDispatch wmi._getfile("winmgmts:")
IDispatch col = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapter" @ wbemFlagReturnImmediately|wbemFlagForwardOnly)
IDispatch x
foreach x col
out "----"
VARIANT v=x.NetworkAddresses
0x1
VARIANT type: VT_NULL
QM type:
note: means there is no data
so how retreive data declared as string but neither str variable or variant v=NULL
example using Win32_NetworkAdapterConfiguration
code used:
IDispatch wmi._getfile("winmgmts:")
IDispatch col = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True" @ wbemFlagReturnImmediately|wbemFlagForwardOnly)
IDispatch x
foreach x col
out "----"
VARIANT v=x.ArpAlwaysSourceRoute
out F"0x{v.vt}"
OutVariantType(v)
how to deal when :
1. variable is boolean like boolean ArpAlwaysSourceRoute
0x1
VARIANT type: VT_NULL
QM type:
note: means there is no data
does not work either with int (QM does not seems to hoeld a boolean type)
2.
IDispatch wmi._getfile("winmgmts:")
IDispatch col = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapter" @ wbemFlagReturnImmediately|wbemFlagForwardOnly)
IDispatch x
foreach x col
out "----"
VARIANT v=x.NetworkAddresses
0x1
VARIANT type: VT_NULL
QM type:
note: means there is no data
so how retreive data declared as string but neither str variable or variant v=NULL