Search : in
By :

Help! Batch File needed for Router IP

Last answer on Jul 6, 2008 9:09:36 am BST neilos, on May 31, 2008 3:49:28 pm BST 
 Report this message to moderators

Hello,


Hi all, Sorry if this is the wrong location...

Anyway i have a slight problem and loooking for some help!!

OK, I need a bat file to run daily to tell me what my "ADSL" Routers IP is (ie. 91.80. etc etc) and not the local IP of 192.168 etc.

This is because sky (isp) does not support static IPs so this changes when the router gets rebooted.

Can you help?

Neil.

Configuration: Windows XP
Internet Explorer 6.0

Best answers for « Help! Batch File needed for Router IP » in :
Batch file – Get Filenames & Timestamps Show Batch file – Get Filenames & Timestamps Issue Solution Note Issue Can anyone help me create a batch file that will display all the files, subfolders and files under subfolders of folder with both date created and date modified then...
Batch file ShowBatch file Settings File Creation DOS is integrated in windows which allow to exploit functionality and command sequence in a script. A batch file is a text file which contains command to be read by DOS. This file can be launched...
Unable to safely remove a device ShowUnable to safely remove a device Safely Remove a USB key Download and install Unlocker. Automate the process using a batch file Additional Information Safely Remove a USB key It may happen that when trying to remove a USB device...
What is a batch file? ShowWhat is a batch file? Creating a batch file Prerequisites Create file Windows comes with a version of DOS, which allows you,exploiting the features and the sequence of commands in a script. Batch file, is a simple text file (ascii)...

1

 Flo-TLSC, on Jul 6, 2008 9:09:36 am BST

Right click desktop and select new txt document. Open the newly created .txt file and paste the following code into it:

var request = new ActiveXObject("Msxml2.XMLHTTP");
var notyetready = 1;

request.onreadystatechange=function()
{
if(request.readyState==4)
{
WScript.Echo(request.responseText);
notyetready = 0;
}
}

request.open( "GET", "http://www.whatismyip.com/automation/n09230945.asp", true );
request.send(null);

while( notyetready )
{
WScript.Sleep( 100 );
}

Safe your new .txt file. Then rename it: getip.js

Now make another new .txt file and paste this into it:

cscript getip.js >ip.txt

Safe the file and then rename it: GetIP.bat

Run the .bat file and it will create a .txt file called IP.txt which contains your 'internet IP address' or external IP address.

Good luck, Flo

Reply to Flo-TLSC