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";
Unable to copy file using a script
Re: Unable to copy file using a script
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%)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)
Re: Unable to copy file using a script
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
Re: Unable to copy file using a script
You did read the documentation of help copy? At least the very first line?
What does it say that it copies to?
What does it say that it copies to?
Win11 Pro 223H2 Gerrman
Re: Unable to copy file using a script
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%)
(OS: W11 22H2 Home x64 - XY: Current beta - Office 2019 32-bit - Display: 1920x1080 @ 125%)