如何用批处理获得PPP拨号连接的IP地址?
[ Last edited by HAT on 2008-10-15 at 20:44 ]
[ Last edited by HAT on 2008-10-15 at 20:44 ]
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Microsoft Windows XP
(C) 版权所有 1985-2001 Microsoft Corp.
C:\WINDOWS>ipconfig
Windows IP Configuration
Ethernet adapter 无线网络 Intel:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.12
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . : 192.168.0.1
Ethernet adapter 本地连接:
Media State . . . . . . . . . . . : Media disconnected
wmic nicconfig where Description="WAN (PPP/SLIP) Interface" get ipaddressnetsh diag show ip 1
@echo off
for /f "tokens=2 delims=:" %%i in ('ipconfig ^|findstr /i "ip address"') do set ip=%%i
echo %ip%
pause