Scripted copy from A to B

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
MBaas
Posts: 692
Joined: 15 Feb 2016 21:08

Scripted copy from A to B

Post by MBaas »

I'm trying to configure a toolbar-button that copies all files from a constant source-path ("H:\BAK-root") to a fix target ("H:\") . So I have entered the following command:

Code: Select all

copyas "*.*", "H:\" , "H:\BAK-root\";
But that creates subdirectories H:\.-01 (conseceutively numbered for every call) and copies the files into these dirs. What am I doing wrong?
____________________________________________________________________________________
Happy user. Screen scaling 100% and W11Pro [Version 10.0.26200.7922], XY 28.30.14000 * * LinkTree

admin
Site Admin
Posts: 66672
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripted copy from A to B

Post by admin »

No, copyas is not the right command here.

Do it like this:

Code: Select all

copyto "E:\Test\copy\To\", "E:\Test\copy\From\*";
In your case:

Code: Select all

copyto "H:\", "H:\BAK-root\*";

MBaas
Posts: 692
Joined: 15 Feb 2016 21:08

Re: Scripted copy from A to B

Post by MBaas »

Ouch - well, that explains everything! How could I miss that? :oops:
Many thanks!
____________________________________________________________________________________
Happy user. Screen scaling 100% and W11Pro [Version 10.0.26200.7922], XY 28.30.14000 * * LinkTree

admin
Site Admin
Posts: 66672
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Scripted copy from A to B

Post by admin »

Well, frankly I needed some time to find this way. It's not that clearly shown in the help. :whistle:

Post Reply