highend wrote: ↑21 Jul 2022 14:22
backupto can't rename a file, the first argument is a path only...
Check if the file exists, delete it, copy it over while giving it a new name...
I'm not entirely sure how, but I managed to make it work with this script
Code: Select all
backupto "C:\Program Files\Plex\Plex\", "D:\Program Files\SVP 4\mpv64\mpv-1.dll"; renameitem("mpv-2", "C:\Program Files\Plex\Plex\mpv-1.dll", 8,);
The only downside being if mpv-1 doesn't already exist at the target destination, it tries to rename before the backupto has a chance to do it's job and says that the file doesn't exist.
But yeah your script is much smoother; I'm just not sure what any of it means. Please forgive my ignorance, let me see if I understand this correctly.
So
Code: Select all
$srcFile = "D:\Program Files\SVP 4\mpv64\mpv-1.dll";
$dstFile = "C:\Program Files\Plex\Plex\mpv-2.dll";
defines what the $srcFile and $dstFile are for the following commands right?
So then
activates xycopy but what is the 0?
Code: Select all
if (exists($dstFile) == 1) { delete 1, 0, $dstFile; }
alright so the "if (exists" and "{ delete" is pretty straightforward, but what does "== 1" and "1, 0," stand for?