hi,
i have this hta that sends an mail with user info and ip address. it works fine as hta. but when we change to html, it errors out on the ip address part.
here's the code:
is there any other way to get ip addres? or fix this to not error out on html?
thanks.
i have this hta that sends an mail with user info and ip address. it works fine as hta. but when we change to html, it errors out on the ip address part.
here's the code:
Code:
StrComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each objAdapter in colAdapters
If Not IsNull(objAdapter.IPAddress) Then
msg = msg & "IP address: " & objAdapter.IPAddress(0) & vbcrlf
End If
next
ip_address_arr = split(msg, vbcrlf)
ip_address = ip_address_arr(0)
thanks.