Board logo

标题: 怎么提取IP地址 [打印本页]

作者: windeshadow     时间: 2007-5-6 02:06    标题: 怎么提取IP地址

我想提取IP地址的最后一位
比如我用ipconfig 命令得到以下信息:

Windows IP Configuration

Ethernet adapter 本地连接 3:



        Connection-specific DNS Suffix  . :

        IP Address. . . . . . . . . . . . : 192.168.0.114
        Subnet Mask . . . . . . . . . . . : 255.255.255.0

        Default Gateway . . . . . . . . . : 192.168.0.254

我想把里面的114或者是192.168.0.114输出到一个文件里.
作者: lxmxn     时间: 2007-5-6 02:49
多搜索啊。
CODE:  [Copy to clipboard]
for /f "delims=: tokens=2" %%a in ('ipconfig^|find /i "IP Address"') do echo %%a>newfile

作者: bob1989     时间: 2007-5-6 18:05
FOR真是太有用了




欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) Powered by Discuz! 2.5