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-08-04 01:18
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Variable question View 640 Replies 11
Original Poster Posted 2007-04-03 22:46 ·  中国 吉林 吉林市 电信
初级用户
Credits 44
Posts 19
Joined 2007-02-12 02:14
19-year member
UID 79266
Gender Male
Status Offline
The following batch file
C:\
cd \
dir /s /b XXX.exe >xxx.txt
What I mean is, set the contents of XXX.txt as variables in this batch file

[ Last edited by hkymadmin on 2007-4-3 at 11:26 AM ]
Floor 2 Posted 2007-04-03 22:53 ·  中国 吉林 吉林市 电信
初级用户
Credits 44
Posts 19
Joined 2007-02-12 02:14
19-year member
UID 79266
Gender Male
Status Offline
Thanks
Floor 3 Posted 2007-04-03 22:53 ·  中国 吉林 吉林市 电信
初级用户
Credits 44
Posts 19
Joined 2007-02-12 02:14
19-year member
UID 79266
Gender Male
Status Offline
Please help....
Floor 4 Posted 2007-04-03 23:18 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
I don't quite understand what the OP wants
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 5 Posted 2007-04-04 00:22 ·  中国 吉林 吉林市 电信
初级用户
Credits 44
Posts 19
Joined 2007-02-12 02:14
19-year member
UID 79266
Gender Male
Status Offline
What I mean is, set the contents of XXX.txt as variables in this batch file
Floor 6 Posted 2007-04-04 00:35 ·  中国 江苏 苏州 联通
银牌会员
★★★
Credits 1,181
Posts 533
Joined 2006-08-14 12:54
19-year member
UID 60484
Status Offline
OP, use for /f ... in ('...') do ...
Floor 7 Posted 2007-04-04 00:37 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

I don't understand it either, so I can't answer.
Floor 8 Posted 2007-04-04 02:32 ·  中国 吉林 吉林市 电信
初级用户
Credits 44
Posts 19
Joined 2007-02-12 02:14
19-year member
UID 79266
Gender Male
Status Offline
Originally posted by NaturalJ0 at 2007-4-3 11:35 AM:
OP, use for /f ... in ('...') do ...

Could you explain it in detail????
Floor 9 Posted 2007-04-04 02:38 ·  中国 湖南 长沙 联通
贫困用户
Credits -2
Posts 20
Joined 2007-01-30 23:49
19-year member
UID 78145
Gender Male
Status Offline
Floor 10 Posted 2007-04-04 02:51 ·  中国 江苏 苏州 联通
银牌会员
★★★
Credits 1,181
Posts 533
Joined 2006-08-14 12:54
19-year member
UID 60484
Status Offline
Floor 11 Posted 2007-04-05 00:10 ·  中国 吉林 吉林市 电信
初级用户
Credits 44
Posts 19
Joined 2007-02-12 02:14
19-year member
UID 79266
Gender Male
Status Offline
Originally posted by NaturalJ0 at 2007-4-3 01:51 PM:
for /f "delims=" %%i in ('dir/s/b c:\hosts 2^>nul') do @echo %%i

Could you leave your contact information??? I still don't quite understand it
Floor 12 Posted 2007-04-05 01:07 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Forum Jump: