Batch file error: “xcopy is not recognized as an internal or external command…”

batch-filebatch-processingxcopy

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?

Best Answer

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