windows - XCOPY not recognized as internal or external command -
i new batch file coding. trying use xcopy copying file. first used this:
@echo off move mypath\abc.txt mypath\abc.txt.0001 xcopy mypath\abc.txt.bak mypath\abc.txt pause this code working fine. needed take input user, o modified code this:
@echo off echo starting application. set /p path=enter path: set /p corruptfilename=enter corrupted file name: set /p oldbackupfilename=enter backup file name restore: set /p correuptedbackupname=enter 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 restore : echo %oldbackupfilename% move %path%\%corruptfilename% %path%\%correuptedbackupname% call :waitfor 5000>nul xcopy %path%\%oldbackupfilename% %path%\%corruptfilename% pause this code not running. says :
the system cannot find batch label specified - waitfor 'xcopy' not recognized internal or external command, operable program or batch file. can shed light in this?
thanks!
%path% environment variable used tell operating system programs located. without it, have give full path system executables (like xcopy) before can called name only.
never overwrite it.
change variable name else. else.
Comments
Post a Comment