Batch file error: "xcopy is not recognized as an internal or external command..."

JSUPRA picture JSUPRA · Aug 26, 2014 · Viewed 29k times · Source

I'm programming a batch file and after a long amount of code, I have:

:d1copy
xcopy /Y "C:\Users\Joseph\Desktop\JOKO_Sync\*.*" "F:\JOKO_Sync\*.*" /s /e /V /D
pause

When I execute this, I get the error

xcopy is not recognized as an internal or external command, operable program or batch file.

Yet I copy and paste this same code into another batch file, and it works perfectly.

Any ideas?

Answer

Am_I_Helpful picture Am_I_Helpful · Aug 26, 2014

Your Path environment variable doesn't contain C:\Windows\System32. Please try adding it and your error will be resolved!