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

I am programming a batch file and after a lot 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, operating program, or batch file.

However, I copy and paste this same code into another batch file and it works fine.

Any ideas?

+3


source to share


3 answers


Path

Doesn't contain environment variable C:\Windows\System32

. Try adding it and your error will be resolved!



+9


source


Perhaps you might have set path = something defined in your batch file. This way it will change your current system path variable. If so, change your batch file variable name to something other than "path" (ex: mypath) and it will work.



+1


source


Copying the xcopy.exe

file from C:/Windows/System32

to JAVA_SDK/bin

worked for me.

0


source







All Articles