China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

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!

中国DOS联盟论坛
The time now is 2026-06-30 03:43
中国DOS联盟论坛 » DOS疑难解答 & 问题讨论 (解答室) » I want to use IPCONFIG /ALL to list values like the IP and gateway, then assign those two values to AAA and BBB View 737 Replies 3
Original Poster Posted 2006-03-30 08:56 ·  中国 广东 深圳 电信
初级用户
Credits 60
Posts 14
Joined 2006-03-23 09:28
20-year member
UID 52635
Status Offline
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?
Floor 2 Posted 2006-03-30 09:39 ·  中国 湖北 荆门 电信
荣誉版主
★★★
Credits 2,013
Posts 718
Joined 2006-02-18 07:07
20-year member
UID 50550
Status Offline
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
Floor 3 Posted 2006-03-30 20:26 ·  中国 广东 深圳 电信
初级用户
Credits 60
Posts 14
Joined 2006-03-23 09:28
20-year member
UID 52635
Status Offline
Floor 4 Posted 2006-03-31 00:09 ·  中国 广东 广州 海珠区 电信
金牌会员
★★★★
D◎$ Fαп
Credits 4,562
Posts 1,883
Joined 2004-01-19 00:00
22-year member
UID 15812
Gender Male
From 广东广州
Status Offline
Originally posted by 024024 at 2006-3-30 20:26:
thinks you.

Are you missing him?
It should be Thank you, another typo. :D
----====≡≡≡≡ 我的至爱,永远是MSDOS!≡≡≡≡====----
Forum Jump: