Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Obtaining an IP address using @WMI and WMIQUERY

Aug
1,933
71
While you can use @IPADDRESS to obtain the IP address of a specific host, you can also use @WMI and WMIQUERY. Example;

Code:
echo %@wmi[root\cimv2,"SELECT ProtocolAddress FROM Win32_Pingstatus where address='jpsoft.com'"]

or

Code:
wmiquery root\cimv2 "SELECT ProtocolAddress FROM WIN32_Pingstatus where address='jpsoft.com'"

Yes, @IPADDRESS returns the IP address much faster than @WMI and WMIQUERY, but this is just an example of doing the same thing using an alternate method.

You can see the other properties of Win32_PingStatus by visiting http://msdn.microsoft.com/en-us/library/aa394350%28v=vs.85%29.aspx

Joe
 
While you can use @IPADDRESS to obtain the IP address of a specific host, you can also use @WMI and WMIQUERY. Example;

Code:
echo %@wmi[root\cimv2,"SELECT ProtocolAddress FROM Win32_Pingstatus where address='jpsoft.com'"]

or

Code:
wmiquery root\cimv2 "SELECT ProtocolAddress FROM WIN32_Pingstatus where address='jpsoft.com'"

Yes, @IPADDRESS returns the IP address much faster than @WMI and WMIQUERY, but this is just an example of doing the same thing using an alternate method.

You can see the other properties of Win32_PingStatus by visiting http://msdn.microsoft.com/en-us/library/aa394350%28v=vs.85%29.aspx

Joe
Thanks for being nice here. People like you are always there to help others.
This query totally worked and in the faster way than the other one once again thanks
 
Back
Top