以下是一个简短的批处理文件。
if exist ("help/user/Content/build.xml") ( echo file exists) ELSE (echo File Deleted)
if exist ("archibus.war") (echo File not deleted!) ELSE (echo File Deleted)
if exist ("build.xml") ( echo file exists) ELSE (echo File Deleted)
即使文件确实存在,也永远不会找到它们。我没有正确指定路径吗?
答案 0 :(得分:2)
路径还可以。只需删除文件名上的(
和)
:
if exist "help/user/Content/build.xml" ( echo file exists) ELSE (echo File Deleted)
if exist "archibus.war" (echo File not deleted!) ELSE (echo File Deleted)
if exist "build.xml" ( echo file exists) ELSE (echo File Deleted)