Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > BgInfo
  New Posts New Posts RSS Feed: Display Dynamic WAN IP address
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Display Dynamic WAN IP address

 Post Reply Post Reply
Author
Message Reverse Sort Order
flippertie View Drop Down
Newbie
Newbie


Joined: 28 September 2009
Online Status: Offline
Posts: 8
Post Options Post Options   Quote flippertie Quote  Post ReplyReply Direct Link To This Post Topic: Display Dynamic WAN IP address
    Posted: 15 November 2009 at 2:05pm
FWIW - my problem with the custom field returning (Null) was down to my carelesness.

I have discovered that "Wan_Ip" is not the same as "WAN_IP" </facepalm>


Back to Top
flippertie View Drop Down
Newbie
Newbie


Joined: 28 September 2009
Online Status: Offline
Posts: 8
Post Options Post Options   Quote flippertie Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2009 at 5:33am
I'm not sure what the issue was but I have the script working fine now. I just deleted and recreated the custom field on the problem pcs and all is running smoothly.

The issues I was having (hanging bginfo, long delay when running the script, and not displaying the custom field) are all resolved.

Thanks for help and the script.
Back to Top
flippertie View Drop Down
Newbie
Newbie


Joined: 28 September 2009
Online Status: Offline
Posts: 8
Post Options Post Options   Quote flippertie Quote  Post ReplyReply Direct Link To This Post Posted: 26 October 2009 at 2:36pm
Do you mean that you log to a file, using the Database feature?

That's right - I log to a csv file and have a spreadsheet that links to it.  I'd like to include the custom field in Bginfo's output record.

However - I'm probably going to abandon this idea (including the WAN IP address) as it's proving more trouble for me than the benefit's it would provide.

I can't run the script at boot/login time on some of the pcs. It slows the boot time considerably as the script takes much longer to complete (probably has to wait for an internet connection to be established). 

And of the three PC's I've tried so far it only works on one. The other two display a value of '(none)'. This happens even when I run the script manually after the pc has booted and the internet connection is active.  I've not been able to establish what the difference is...
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Online Status: Offline
Posts: 17492
Post Options Post Options   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 26 October 2009 at 11:18am
 I use bginfo's log feature
Do you mean that you log to a file, using the Database feature?
Daily affirmation:
net helpmsg 4006
Back to Top
flippertie View Drop Down
Newbie
Newbie


Joined: 28 September 2009
Online Status: Offline
Posts: 8
Post Options Post Options   Quote flippertie Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2009 at 4:26pm
I've tried it on a total of 3 PCs so far. 

On one it seems to work fine, but on the others i get  (none) where the IP address should be.

On the first PC that was giving me the hanging problem I did see the IP address once but when I restarted the PC and ran BGinfo at startup I get the (none) and the same on the third machine. 

I  guess it must be something to do with the setups as the script works OK.  I'll play with it some more when I have access to them again and see if I can identify the cause.

Another question: I use bginfo's log feature to keep track of disc space. Is there any way to add the custom WAN_IP field to the log file?

thanks.
Back to Top
n8felton View Drop Down
Newbie
Newbie
Avatar

Joined: 14 October 2009
Location: Rochester, NY
Online Status: Offline
Posts: 17
Post Options Post Options   Quote n8felton Quote  Post ReplyReply Direct Link To This Post Posted: 14 October 2009 at 1:46pm
Does the background show the information you want once you actually apply BGInfo, or is it not working at all?
--
The two basic principles of Windows system administration:
    * For minor problems, reboot
    * For major problems, reinstall
Back to Top
flippertie View Drop Down
Newbie
Newbie


Joined: 28 September 2009
Online Status: Offline
Posts: 8
Post Options Post Options   Quote flippertie Quote  Post ReplyReply Direct Link To This Post Posted: 14 October 2009 at 5:25am
Strange.

With the custom field defined,  if I try to preview the screen bginfo hangs, and I need to kill the process.  I can do everything else to format the output but the preview button is a show stopper.

Don't know if it's just my system - haven't tried it anywhere else but this might just stop someone else panicing in the future :)


Back to Top
flippertie View Drop Down
Newbie
Newbie


Joined: 28 September 2009
Online Status: Offline
Posts: 8
Post Options Post Options   Quote flippertie Quote  Post ReplyReply Direct Link To This Post Posted: 14 October 2009 at 3:35am
Mr Felton!

Thank you  for taking the time to register here to answer my query.  I am happily grateful and shall do my best to spread happy electrons throughout the interweb today as a token of my appreciation!

Flip
Back to Top
n8felton View Drop Down
Newbie
Newbie
Avatar

Joined: 14 October 2009
Location: Rochester, NY
Online Status: Offline
Posts: 17
Post Options Post Options   Quote n8felton Quote  Post ReplyReply Direct Link To This Post Posted: 14 October 2009 at 2:02am
The easiest way to do this is to create a custom field and then use a VB Script to populate this field.

1. Create a VBScript named "WAN_IP.vbs" in the same directory as your "BGInfo.exe" application. The contents of this VBScript should be:

Function WAN_IP
   Set objxmlHTTP = CreateObject("Microsoft.XMLHTTP")
   Call objxmlHTTP.open("get", "http://checkip.dyndns.org", False)
   objxmlHTTP.Send()
 
   strHTMLText = objxmlHTTP.ResponseText
   Set objxmlHTTP = Nothing
 
   If strHTMLText <> "" Then
       varStart = InStr(1, strHTMLText, "Current IP Address:", vbTextCompare) + 19
       If varStart Then varStop = InStr(varStart, strHTMLText,"</body>", vbTextCompare)
       If varStart And varStop Then strIP = Mid(strHTMLText, varStart, varStop - varStart)
   Else
       strIP = "Unavailable"
   End If
   WAN_IP = Trim(strIP)
End Function

Echo WAN_IP

2. Open BGInfo and load the configuration file you are using (e.g. default.bgi). Click the "Custom..." button on the right side under the list of fields.

3. Click the "New..." button.

4. Set your identifier to "WAN_IP" and then select the "VB Script file" radio button and click the "Browse" button that is now available and select the "WAN_IP.vbs" script.

5. Click the "OK" buttons till you get back to the original interface for the BGInfo application.

6. Scroll down the list of fields until you find the "WAN_IP" field in the list, select it and click the "<- Add" button.

7. Click the "Preview" button and if all goes well, you should now see the WAN IP address on your desktop.

Hope this helps. Let us know if you run into any issues.
Back to Top
flippertie View Drop Down
Newbie
Newbie


Joined: 28 September 2009
Online Status: Offline
Posts: 8
Post Options Post Options   Quote flippertie Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2009 at 4:59am
I want to configure Bginfo to display a system's current WAN IP address (so the users can read it to me straight off their desktop...)    The PC's are all running XP. 

So I want to create a custom field that would contain the address.   I'm happy to do the work myself (it's good to learn..)- but I dont really know where to start. 

I'd really appreciate any help or pointers to how I can set this up

Thanks!

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down