How to use batch processing to obtain the IP address of a PPP dial-up connection?
[ Last edited by HAT on 2008-10-15 at 20:44 ]
[ Last edited by HAT on 2008-10-15 at 20:44 ]
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
Microsoft Windows XP
(C) Copyright 1985-2001 Microsoft Corp.
C:\WINDOWS>ipconfig
Windows IP Configuration
Ethernet adapter Wireless 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 Local Area Connection:
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