判断文件夹的存在方法通常有以下几种方法:
(假设D盘下存在“hello world”和“good”两个文件夹)
if exist "e:\hello world\" echo 存在
if exist "d:\hello world\." echo 存在
if exist d:\good\. echo 存在
if exist d:\good\nul echo 存在
if exist d:\hellow~1\. echo 存在
if exist d:\hellow~1\nul echo 存在
另外,还可以用 cd 、dir 等命令来判断。个人觉得用 if exist "d:\hello world\." 此方式为最好。
Last edited by newxso on 2008-11-17 at 14:20 ]