Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dim xHttp: Set xHttp = CreateObject("MSXML2.ServerXMLHTTP")
- Set oShell = WScript.CreateObject("WScript.shell")
- Set oFSO = CreateObject("Scripting.FileSystemObject")
- Do
- '==========================================================
- sIpaddress = DNSLookup("www.exampledomain.com")
- xHttp.Open "POST", "http://" + sIpaddress + "/login?username=tony_e&password=QkdQX1J1bGV6MTIzIUAj", False
- xHttp.Send
- oShell.run("ipconfig /flushdns")
- WScript.Sleep 15*1000
- '==========================================================
- Loop
- Function DNSLookup(sAlias)
- If len(sAlias) = 0 Then
- DNSLookup = "Failed."
- Exit Function
- End If
- Const OpenAsDefault = -2
- Const FailIfNotExist = 0
- Const ForReading = 1
- sTemp = oShell.ExpandEnvironmentStrings("%TEMP%")
- sTempFile = sTemp & "\" & oFSO.GetTempName
- oShell.Run "%comspec% /c nslookup " & sAlias & ">" & sTempFile, 0, True
- Set fFile = oFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist, OpenAsDefault)
- sResults = fFile.ReadAll
- fFile.Close
- oFSO.DeleteFile (sTempFile)
- aIP = Split(sResults, "Address:")
- If UBound(aIP) < 2 Then
- DNSLookup = "Failed."
- Else
- aIPTemp = Split(aIP(2), Chr(13))
- DNSLookup = trim(aIPTemp(0))
- End If
- Set oShell = Nothing
- Set oFSO = Nothing
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement