WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

TCPIP and IP Address

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Determine External IP Address


Determine Dynamic External IP Address

Keywords:    external dynamic IP address DHCP network NAT DNS ISP

This will give you a text file with just the external IP number.
Browser = ObjectOpen("InternetExplorer.Application")
browser.visible = @FALSE
browser.navigate ("http://checkip.dyndns.org/")

TimeDelay(2)
:top

If browser.readystate == 4 Then
BrowserDoc = Browser.Document
BrowserBody = BrowserDoc.Body
BrowserPage = BrowserBody.CreateTextRange
BrowserText = BrowserPage.Text
Else
TimeDelay(1)
Goto top
EndIf

out = FileOpen("c:\whatever\ip.txt", "write")
a=StrReplace(browsertext,"Current IP Address: ","")
FileWrite(out,a)


FileClose(out)

Message("Text", BrowserText)

Exit

Article ID:   W17273
File Created: 2007:07:03:14:29:10
Last Updated: 2007:07:03:14:29:10