windowsbatch-filecmdxcopy

Windows xcopy 0 File(s) copied


I am trying to copy a directory but get the following:

xcopy ..\node_modules\ \node_modules\ 

0 File(s) copied

I run as administrator, but still get the error. Any ideas please?

p.s I actually use the following to stipulate it's a directory. But the above also fails:

echo d | xcopy /d /y ..\node_modules\ \node_modules\

Thanks

enter image description here

enter image description here


Solution

  • You can use the xcopy /E flag to copy the entire directory and subdirectories. Also remove the starting \ of the destination. The trailing slash should prevent the file or directory prompt.

    xcopy /E ..\node_modules node_modules\