0
我很新的批处理文件编码。我正在尝试使用XCOPY来复制某些文件。首先我用这样的:XCOPY未被识别为内部或外部命令
@echo off
MOVE mypath\abc.txt mypath\abc.txt.0001
XCOPY mypath\abc.txt.bak mypath\abc.txt
pause
这段代码工作得很好。 然后我需要采取从用户一些输入,邻我修改这样的代码:
@ECHO off
ECHO Starting application.
SET /p path=Enter the path:
SET /p corruptFileName=Enter the corrupted file name:
SET /p oldBackupFileName=Enter the Backup file name to restore:
SET /p correuptedBackupName=Enter the corrupted backup file name:
ECHO Path :
ECHO %path%
ECHO Corrupted file name :
ECHO %corruptFileName%
ECHO Desired Backup file name:
ECHO %correuptedBackupName%
ECHO Backup file name to restore :
ECHO %oldBackupFileName%
MOVE %path%\%corruptFileName% %path%\%correuptedBackupName%
call :waitfor 5000>nul
XCOPY %path%\%oldBackupFileName% %path%\%corruptFileName%
PAUSE
此代码没有运行。它说:
The system cannot find the batch label specified - waitfor
'XCOPY' is not recognized as an internal or external command,
operable program or batch file.
任何人都可以摆脱这个光?
谢谢!
非常感谢!它正在工作! –
@JavaProgrammer - 乐于助人。由于我的答案适合您,请点击我答案旁边的复选标记。 – SomethingDark
完成!接受为答案:) –