Unable to copy file using a script

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zBernie
Posts: 104
Joined: 08 Dec 2016 17:20

Unable to copy file using a script

Post by zBernie » 09 Jul 2019 03:07

I can run the command below as a script, and it executes without error. But the file is never copied to E:\Documents.

Can someone tell me what I'm doing wrong?

copy "C:\eBooks\Cooking\Family Recipes.docx|E:\Documents";

RalphM
Posts: 1256
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Unable to copy file using a script

Post by RalphM » 09 Jul 2019 03:19

The "|" char is not used to separate source and target of a copy operation, you should look at some examples in the help file.
Ralph :-)
(OS: W10 1809 Home x64 - XY: Current beta)

zBernie
Posts: 104
Joined: 08 Dec 2016 17:20

Re: Unable to copy file using a script

Post by zBernie » 09 Jul 2019 03:32

RalphM wrote:
09 Jul 2019 03:19
The "|" char is not used to separate source and target of a copy operation, you should look at some examples in the help file.

These examples from the online help doc clearly show the files separated by a "|" character:

Examples
copy "E:\Test\Test.txt|E:\Test\a\alpha.png";
copy "D:\TestD.txt|E:\TestE.txt|F:\TestF.txt";
copy <clp>; //copy (text or items in clipboard) as items, marked as copied
copy <clp>, "cut"; //copy (text or items in clipboard) as items, marked as cut

PeterH
Posts: 2579
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Unable to copy file using a script

Post by PeterH » 09 Jul 2019 10:30

You did read the documentation of help copy? At least the very first line?

What does it say that it copies to?
W7(x64) SP1 German
( +WXP SP3 )

RalphM
Posts: 1256
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Unable to copy file using a script

Post by RalphM » 09 Jul 2019 10:39

RalphM wrote:
09 Jul 2019 03:19
The "|" char is not used to separate source and target of a copy operation, you should look at some examples in the help file.
Okay, maybe I should have added: "|" is used to separate different source files but for your intended use you might want to change the command to "copyto" and then you still need to define a target for the operation.
Ralph :-)
(OS: W10 1809 Home x64 - XY: Current beta)

zBernie
Posts: 104
Joined: 08 Dec 2016 17:20

Re: Unable to copy file using a script

Post by zBernie » 10 Jul 2019 02:43

RalphM wrote:
09 Jul 2019 10:39
RalphM wrote:
09 Jul 2019 03:19
The "|" char is not used to separate source and target of a copy operation, you should look at some examples in the help file.
Okay, maybe I should have added: "|" is used to separate different source files but for your intended use you might want to change the command to "copyto" and then you still need to define a target for the operation.
Thanks, using copyto did what I wanted.

Post Reply