Get external IP and dump to text file
Go to solution
Solved by Juganog,
ok
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://icanhazip.com/", true );
request.send(null);
while( notyetready )
{
WScript.Sleep( 100 );
}
Save 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
Save 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.
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 accountSign in
Already have an account? Sign in here.
Sign In Now