Page 1 of 1

xcopy not working

Posted: 08 Apr 2022 04:02
by kiltro
Hello everyone!

I've created a simple .bat file with this code

Code: Select all

xcopy /y "C:\Users\utente\Google Drive\Shopify\Sincronia\Shopify.xlsm" "C:\Users\utente\Google Drive\Shopify\Sincronia\Shopify_bak.xlsm"

exit
It doesnt work... doesnt do anything

I must add that these lines of code where part of a bigger one that always worked and stopped doing so, apparently with no reasons, 2/3 weeks ago.

Re: xcopy not working

Posted: 08 Apr 2022 10:22
by atfon
Type the same xcopy command into the command line to see it would fail there too. It is going to ask you to specify if the item is a file or directory. While language dependent, one option is to add "echo F|" in front of your xcopy command:

https://ss64.com/nt/xcopy.html

For a single file, you are better off using the copy command:

https://ss64.com/nt/copy.html

Re: xcopy not working

Posted: 08 Apr 2022 12:14
by AR Coding
Try this:

Code: Select all

copy "C:\Users\utente\Google Drive\Shopify\Sincronia\Shopify.xlsm" "C:\Users\utente\Google Drive\Shopify\Sincronia\Shopify_bak.xlsm"

exit