How can I copy a file from one dir to another with a .bat file
-
30-09-2019 - |
Question
I have the code:
xcopy /s C:\Documents and Setting\WindowsXP-VM\Desktop\USB\* to C:\Documents and Setting\WindowsXP-VM\Desktop\startup
pause
Saved in a .bat file and when I run it it says Invalid Number of Parameters I have looked on google for abit and cant figure this out I even tried putting the dest in quotes and that gave me another error.
Solution
The spaces are throwing things off; wrap your paths in quotes:
xcopy /s "C:\Documents and Setting\WindowsXP-VM\Desktop\USB\*" "C:\Documents and Setting\WindowsXP-VM\Desktop\startup"
pause
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow