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: 179
Joined: 08 Dec 2016 17:20

Unable to copy file using a script

Post by zBernie »

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: 1935
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: Unable to copy file using a script

Post by RalphM »

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: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

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

Re: Unable to copy file using a script

Post by zBernie »

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: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Unable to copy file using a script

Post by PeterH »

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

What does it say that it copies to?
Win11 Pro 223H2 Gerrman

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

Re: Unable to copy file using a script

Post by RalphM »

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: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)

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

Re: Unable to copy file using a script

Post by zBernie »

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