Jump to content

Check Your IP From Behind A Router


Redhatcc

Recommended Posts


Why are you trying to find your IP in a bat file

well its a little project were messing with here at work. kinda confusing but..

i'll mess around with it and see what i can come up with to get this to launch in a batch and save to txt.

but any ideas would be helpful ;)

Link to comment
Share on other sites

Create a file getip.js:

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 );
}

Create a batch file:

cscript getip.js >ip.txt

Done!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...