Skip to content

Instantly share code, notes, and snippets.

@yutopio
Created December 7, 2020 11:39
Show Gist options
  • Save yutopio/4bc160afa1a7127d88f010404ee84823 to your computer and use it in GitHub Desktop.
Save yutopio/4bc160afa1a7127d88f010404ee84823 to your computer and use it in GitHub Desktop.
Get IP for the machine.
Option Explicit
Dim oReq
Set oReq = CreateObject("MSXML2.XMLHTTP.3.0")
oReq.Open "GET", "http://checkip.dyn.com/", False
oReq.Send
Dim oDom
Set oDom = CreateObject("MSXML2.DOMDocument")
oDom.LoadXML(oReq.ResponseText)
Dim obj
For Each obj In oDom.documentElement.selectNodes("/html/body")
Echo Replace(obj.text, "Current IP Address: ", "")
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment