Search code examples
batch-filexcopy

Xcopy is missing parameters and will not copy files


I am trying to make a .bat file that will copy another batch file to the windows start up directory. but XCOPY keeps saying it is missing parameters, can you have a look at my code and see where I'm going wrong.

xcopy "c:\Desktop\CHAOSCOPY.bat" *.* "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\"

xcopy "c:\Desktop\CHAOS V2.bat" *.* "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\" 

xcopy "c:\Desktop\CHAOS.bat" *.* "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\" 

Solution

  • xcopy syntax is

    xcopy sourcedecription destinationdescription

    (disregarding any switches)

    What is your code supposed to do? Is "c:\Desktop\CHAOSCOPY.bat" a file you want to copy? If so, copy it to where? What has *.* got to do with the matter? It specifies all files with an extension. Do you want to copy all files with an extension from the current directory and also "c:\Desktop\CHAOSCOPY.bat" to the destination? If so, you need two separate xcopy commands. cmd cannot read your mind - it can't tell which of the three parameters is source and which destination.