Mike
Mike

Reputation: 83

How can I copy a file from one dir to another with a .bat file

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.

Upvotes: 1

Views: 7090

Answers (1)

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

Upvotes: 3

Related Questions