Page 1 of 1
script copy file
Posted: 12 Aug 2011 12:22
by swan_x
i have file 555.txt in C: and i want with a script one copy of this in D: and OverwriteExisting (for continuous backup)
i've tried this script
Copy "C:\555.txt" "D:\" OverwriteExisting
but have this error
<None of the items to copy does exist>
why???
Re: script copy file
Posted: 12 Aug 2011 12:26
by highend
You've read the help file?
Code: Select all
copy
Copies item(s) to the clipboard.
and now read the entry for backupto
Re: script copy file
Posted: 12 Aug 2011 12:46
by swan_x
ok tnxs for reply....but was no longer simply a practical example???
Re: script copy file
Posted: 12 Aug 2011 19:04
by swan_x
this script work fine:
backupto "D:\", "C:\555.txt", 2
but now i have 2 files....555.txt & 666.txt
with backupto "D:\", "C:\*.txt", 2 don't copy nothing!!
with backupto "D:\", "C:\*.*", 2 don't copy nothing!!
where is my error???
Re: script copy file
Posted: 13 Aug 2011 01:11
by RalphM
A quick guess is your quoting.
You wan't the *.txt to be expanded at runtime, but with "quoting" it's taken as is...
Edit: Sorry, I was wrong. See the following excerpt from Help on Scripting Command moveto:
Code: Select all
In the case of copyto and moveto, the source(s) may contain wildcards, for example:
copyto "D:\Backup\XY files\<date yyyy-mm-dd>", "<xydata>\*.ini|<xydata>\*.dat"
Copies all *.ini and *dat file from the XYplorer data path to D:\Backup\XY files\2008-04-22\ (if that's the date today).
Note that backupto, however, does not support wildcards!
Especially the last sentence!
So, you either have to switch to copyto instead or list your two files separately.
Re: script copy file
Posted: 13 Aug 2011 11:30
by swan_x
no, no, no...
<backupto, however, does not support wildcards> ok but now i have 2 file with same extension.....txt
this trick not work if i have 2 different file (from backupto)
but with the script
backupto "D:\", "C:\*.txt", 2
should copy the 2 files, but you do not copy anything!!!
Re: script copy file
Posted: 13 Aug 2011 19:11
by swan_x