BGInfo – Script for Local IP, Public IP and ISP Name

I recently created 3 scripts for BGInfo … If you need it, use it ;)

Local IP.vbs

I found this script at and adapted to my needs. I removed VMware local IP, because I don’t need it

strMsg = ""
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress,description from Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'")
For Each IPConfig in IPConfigSet
	If Not IsNull(IPConfig.IPAddress) Then
	For i = LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
		If Not Instr(IPConfig.IPAddress(i), ":") > 0 Then
			If InStr(1, IPConfig.description(i), "VMware") = 0 Then
				strMsg = strMsg & IPConfig.IPAddress(i)
				If i > 0 Then
					strMsg = strMsg & vbcrlf & VBTab
				End If
			End If
		End If
	End If
Echo strMsg

Public IP.vbs

Based on script from
I’m retrieving my public IP from

Dim o
Set o = CreateObject("MSXML2.XMLHTTP") "GET", "", False
echo o.responseText

ISP Name.vbs

I’m using for this task

Set o = CreateObject("MSXML2.XMLHTTP") "GET", "", False
strid = o.responseText
Set myRegExp = New RegExp
With myRegExp
	.Pattern    = "< h 1 >(.*)< / h 1 >" 'remove space between h and 1
	.IgnoreCase = False
	.Global     = False
End With
Set myMatches = myRegExp.Execute(strid)
Echo myMatches.Item(0).SubMatches(0)

Because my regex contain HTML tags I added space between h and 1. If you want to use my script remove space between h and 1!

No Comments Yet.

Leave a Comment