中国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-10-26 23:34
47,815 topics / 349,928 posts / today 0 new / 48,289 members
DOS启动盘 & LOGO技术 (启动盘室) » How to check whether a specific directory exists in the working directory
Printable Version  655 / 2
Floor1 ravkey Posted 2003-11-20 00:00
初级用户 Posts 27 Credits 189
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?
Floor2 Roy Posted 2003-11-20 00:00
管理员 Posts 1,633 Credits 4,869
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.
Floor3 ravkey Posted 2003-11-20 00:00
初级用户 Posts 27 Credits 189
Thanks
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023