computing
  • 6

Solved Xcopy – File Not Found?

  • 6

ok, i have a folder named “FOLDER” which is located at c:\FOLDER
This folder contains another folder named “CONFIG” and a batch file “TEST.bat”

the TEST.bat has this code:


xcopy config C:\1/e/y/v/i/s
pause

This code runs properly and it does what i want to do ( copy CONFIG files to C:\1 )
But from microsoft’s website, it says that the syntax should be:


xcopy \config C:\1/e/y/v/i/s
pause

This code produces an error:

C:\FOLDER>xcopy \config C:\1/e/y/v/i/s
File not found – config
0 File(s) copied

C:\FOLDER>pause
Press any key to continue . . .

 

Is there something wrong with my computer?
I don’t know why i get error when I add “\” on the source.
I don’t want to specify the full path c:\folder\config because i want a batch file that will work regardless of the path of the directory “FOLDER

Share

1 Answer

  1. So, I recreated what you were trying to do and got the same error, with that in mind, I would just stick with what works. A different approach would be:

    C:\folder\> xcopy config\*.* C:\1 .

    But that still doesn’t use the backslash.

    After looking through both the MS-DOS User’s Guide and MS-DOS encylopedia, you can, however, specify the command like this:

    C:\folder\> xcopy \folder\config C:\1
    OR
    C:\> xcopy \folder\config C:\1

    Any of these will work.
    (Same person, sorry, username troubles.)

    • 0