中国DOS联盟论坛

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-18 02:13
47,814 topics / 349,907 posts / today 4 new / 48,259 members
DOS疑难解答 & 问题讨论 (解答室) » I want to use IPCONFIG /ALL to list values like the IP and gateway, then assign those two values to AAA and BBB
Printable Version  784 / 3
Floor1 024024 Posted 2006-03-30 08:56
初级用户 Posts 14 Credits 60
I want to use IPCONFIG /ALL to list values like the IP and gateway,
then assign those two values to AAA and BBB.
How should I write it?
Floor2 3742668 Posted 2006-03-30 09:39
荣誉版主 Posts 718 Credits 2,013
for /f "delims=: tokens=2" %i in ('"ipconfig | find /i "ip address""') do set ip=%i
for /f "delims=: tokens=2" %i in ('"ipconfig | find /i "default gateway""') do set gateway=%i
If you use it in a batch file, you need to change %i to %%i
Floor3 024024 Posted 2006-03-30 20:26
初级用户 Posts 14 Credits 60
Floor4 JonePeng Posted 2006-03-31 00:09
金牌会员 Posts 1,883 Credits 4,562 From 广东广州
Originally posted by 024024 at 2006-3-30 20:26:
thinks you.

Are you missing him?
It should be Thank you, another typo. :D
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023