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-07-23 19:58
中国DOS联盟论坛 » DOS启动盘 & LOGO技术 (启动盘室) » How to check whether a specific directory exists in the working directory View 509 Replies 2
Original Poster Posted 2003-11-20 00:00 ·  中国 浙江 绍兴 电信
初级用户
Credits 189
Posts 27
Joined 2003-03-14 00:00
23-year member
UID 1131
Gender Male
Status Offline
1. How do I check in the working directory whether a specific directory exists, and create that specific directory if it doesn't exist

2. Does anyone know how to use the "FOR" command in a batch file?
Floor 2 Posted 2003-11-20 00:00 ·  中国 香港 有线宽频用户
管理员
★★★★
專業島民
Credits 4,869
Posts 1,633
Joined 2002-12-10 00:00
23-year member
UID 465
Gender Male
Status Offline
1.
if not exist .\特定目录\nul md .\特定目录

2.
C:\>for /?
Executes a specified command for each file in a set of files.

FOR %variable IN (set) DO command

%variable specifies a replaceable parameter.
(set) specifies a set of one or more files. Wildcards may be used.
command specifies the command to execute for each file.
command-parameters
specifies parameters or switches for the specified command.

If you use the FOR command in a batch program, specify %%variable instead of
%variable. Variable names are case-sensitive, so %i is different from %I.
我的網站:http://mw16.2ya.com/ 我的網誌: http://scrappedblog.blogspot.com/
~
我的Winamp正在播放的歌曲:
Floor 3 Posted 2003-11-20 00:00 ·  中国 浙江 绍兴 电信
初级用户
Credits 189
Posts 27
Joined 2003-03-14 00:00
23-year member
UID 1131
Gender Male
Status Offline
Thanks
Forum Jump: