@echo off
echo On Error Resume next >checkip.vbs
echo Set oDOM=WScript.GetObject("http://www.ip138.com/ip2city.asp") >>checkip.vbs
echo Do Until oDOM.readyState="complete" >>checkip.vbs
echo WScript.sleep 100 >>checkip.vbs
echo Loop >>checkip.vbs
echo str = Split(oDOM.documentElement.outerText,"[") >>checkip.vbs
echo Set oDOM=nothing >>checkip.vbs
echo ip = Split(str(1),"]") >>checkip.vbs
echo Set FSO = CreateObject("Scripting.FileSystemObject") >>checkip.vbs
echo Set SCF = FSO.OpenTextFile(FSO.BuildPath(FSO.GetSpecialFolder(0),"ip.txt"),2,True) >>checkip.vbs
echo SCF.Write(ip(0)) >>checkip.vbs
echo SCF.Close >>checkip.vbs
echo fso.DeleteFile(WScript.ScriptName) >>checkip.vbs
checkip.vbs
set/p n=<%windir%\ip.txt&cls
echo 請將IP位址改為:%n%
notepad C:\Windows\System32\drivers\etc\hosts