问下,我是局域网,即内网的,请问什么DOS命令可以查看外网IP,不要用ip138.com.或其他软件,
ping,ipconfig/all,都不可以tracert 差的比较接近,也不准确,请求高手解决。
------解决方案--------------------------------------------------------
test.bat
@echo off
set "URL=http://www.ip138.com/ip2city.asp"
>%temp%\download.vbs echo Set objDOM = WScript.GetObject(WScript.Arguments(0))
>>%temp%\download.vbs echo Do Until objDOM.ReadyState = "complete"
>>%temp%\download.vbs echo WScript.Sleep 100
>>%temp%\download.vbs echo Loop
>>%temp%\download.vbs echo WScript.Echo objDOM.DocumentElement.OuterText
for /f "tokens=2 delims=[]" %%a in ('cscript //nologo //e:vbscript %temp%\download.vbs "%URL%"') do (
set "PublicIP=%%a"
)
echo,%PublicIP%
pause