这个时候在基本的if语句中出乎意料

时间:2012-09-11 18:28:42

标签: file if-statement batch-file exists

我正在尝试这个并且无法让它发挥作用?获取datareal \ copiesdonotdelete.txt此时出乎意料。

rem @echo off
if exists datareal\copiesdonotdelete.txt goto DoFunction1
Goto DoFunction2
Exit
:DOFunction1
rename data datatemp
rename datareal data
rename datatemp datacopyfiles
Echo Done
Exit
:DOFunction2
 rename data datatemp
 rename datacopyfiles data
 rename datatemp datareal
 Echo Done
 Exit

1 个答案:

答案 0 :(得分:10)

它存在不存在

if exist datareal\copiesdonotdelete.txt goto DoFunction1