我有一个关于批处理文件中if - else结构的问题。每个命令都是单独运行的,但是我不能安全地使用"if - else“块,所以我的程序的这些部分不能工作。我怎样才能让这些部件运行起来呢?谢谢。
IF %F%==1 IF %C%==1 (
::copying the file c to d
copy "%sourceFile%" "%destinationFile%"
)
ELSE IF %F%==1 IF %C%==0 (
::moving the file c to d
move "%sourceFile%" "%destinationFile%"
)
ELSE IF %F%==0 IF %C%==1 (
::copying a directory c from d, /s: boş olanlar hariç, /e:boş olanlar dahil
xcopy "%sourceCopyDirectory%" "%destinationCopyDirectory%" /s/e
)
ELSE IF %F%==0 IF %C%==0 (
::moving a directory
xcopy /E "%sourceMoveDirectory%" "%destinationMoveDirectory%"
rd /s /q "%sourceMoveDirectory%"
)
https://stackoverflow.com/questions/11081735
复制相似问题