Open Vadimpa opened 3 years ago
Thank you for creating the issue! One of our team members will get back to you shortly with additional information. If this is a product issue, please close this and contact the particular product's support instead (see https://support.microsoft.com/allproducts for the list of support websites).
@Vadimpa Where's the doc?
Sample:
function Alive(sHost, ByRef IP, ByRef FQDN) dim objPing, obj Alive = false FQDN = sHost IP = sHost on error goto 0 set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._ ExecQuery("select * from Win32_PingStatus where address = '" & sHost & "' and ResolveAddressNames = 'true'") for each obj in objPing Alive = Not ((IsNull(obj.StatusCode) or obj.StatusCode <> 0)) IP = obj.ProtocolAddress if obj.PrimaryAddressResolutionStatus = 0 then FQDN = obj.ProtocolAddressResolved exit for next set objPing = nothing end function
dim sHost:sHost = "8.8.8.8" dim sDNSName dim sIP
if Alive(sHost, sIP, sDNSName) then wscript.echo "host = " & sHost & ", ip = " & sIP & ", DNS name = " & sDNSName else wscript.echo " host " & sHost & " is not alive" end if
worked on windows 7-, but doesn't worked on windows 10
Why?