如何检查带空格的目录或文件名是否存在
@echo off
if not exist "C:\"Documents and Settings"\box\putty\file"
(
echo hello
)
pause
错误:
'and' is not recognized as an internal or external command,
operable program or batch file.
hello
Press any key to continue . . .
答案 0 :(得分:4)
取出其他引号,路径仅被一组引号包围(""
)
@echo off
if not exist "C:\Documents and Settings\box\putty\file" (
echo hello
)
pause
确保" (