Get System IP Address using VBScript

Following is the code to get the IP Address of the system using VBScript (.vbs)

dim Nics, StrIP
Set Nics= GetObject(“winmgmts:”) .InstancesOf(“Win32_NetworkAdapterConfiguration”)
For Each Nic in Nics
if Nic.IPEnabled then
StrIP = Nic.IPAddress(i)
Wscript.Echo “IP Address: “&StrIP
wscript.quit
end if
Next

Above script will read the Network Adapter Configuration and loop through the first NIC and display a message box containing the system IP Address.