![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-04 10:07 |
48,038 topics / 350,123 posts / today 0 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » Question for batch experts: a DOS batch file problem ●●●●●●●● |
| Printable Version 876 / 5 |
| Floor1 clf98 | Posted 2007-04-26 03:54 |
| 新手上路 Posts 2 Credits 6 | |
|
Question for batch experts: a DOS batch file problem ●●●●●●●●
I want to run a batch file on a schedule. When I run ipconfig, it looks like this: Windows IP Configuration Ethernet adapter Wireless Network Connection: Connection-specific DNS Suffix . : IP Address. . . . . . . . . . . . : 218.29.153.103 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 218.29.153.254 I only want to output 218.29.153.103 into the text file ipconfig.txt and save it as a log! What should I do? Because the IP is assigned by DHCP, the line with 218.29.153.103 sometimes changes (because sometimes it disconnects and then reconnects). The ideal effect for the ipconfig.txt log would be like this: 218.29.153.103 218.29.153.122 218.29.153.4 218.29.153.55 . . . Please help, experts! |
|
| Floor2 lxmxn | Posted 2007-04-26 04:32 |
| 版主 Posts 4,938 Credits 11,386 | |
| Floor3 clf98 | Posted 2007-04-26 08:56 |
| 新手上路 Posts 2 Credits 6 | |
Originally posted by lxmxn at 2007-4-25 03:32 PM: Moderator, thanks! Awesome! |
|
| Floor4 BWSkyer | Posted 2007-04-26 10:03 |
| 中级用户 Posts 180 Credits 367 From 重庆 | |
|
There's one thing I don't understand about for: what exactly does tokens=2 mean? If it means the 2nd line, I just can't make sense of it no matter how I think about it...
|
|
| Floor5 llztt | Posted 2007-04-26 10:30 |
| 中级用户 Posts 44 Credits 204 | |
|
OP, please write your title properly and make it clear it's DOS batch. I came in and found it's actually CMD, what a mess.
|
|
| Floor6 lxmxn | Posted 2007-04-26 11:16 |
| 版主 Posts 4,938 Credits 11,386 | |
Originally posted by BWSkyer at 2007-4-25 21:03: tokens=2 means the second column. You can search the forum for posts about how to use the for command. |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |