当前位置: 代码迷 >> Windows2000 >> 如何查看本机IP
  详细解决方案

如何查看本机IP

热度:2246   发布时间:2013-02-26 00:00:00.0
怎么查看本机IP
问下,我是局域网,即内网的,请问什么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
  相关解决方案