Код: Выделить всё
var xmlHttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");
xmlHttp.open( "GET", "http://checkip.dyndns.org/", false ); // false for synchronous request
xmlHttp.send();
var xml = new ActiveXObject("Msxml2.DOMDocument.3.0");
xml.loadXML(xmlHttp.responseText);
var body = xml.documentElement.selectSingleNode("body");
var objFSO = new ActiveXObject("Scripting.FileSystemObject");
var objFile = objFSO.CreateTextFile("myip.txt", true);
objFile.Write(body.text);
objFile.Close();
var myMsgBox=new ActiveXObject("wscript.shell");
myMsgBox.Popup (body.text);
Правда, dyndns не очень резво отвечает, но если ответит, в файле будет строка:
Код: Выделить всё
Current IP Address: xxx.xxx.xxx.xxx