I have a script to copy my XYplorer tree into some backup drive and path.
The copy works fine but after copying I try to delete the thumbnail files from this backup.
It doesn't work.
I can't find out how to simply delete files in a script without any active selections or other stuff.
Here is my script:
copyto "D:\backups\XYplorer_v<xyver> (on <date yyyy-mm-dd>)", "<xypath>", , , 2;
delete 0, 0, "D:\backups\XYplorer_v<xyver> (on <date yyyy-mm-dd>)\XYplorer\Data\Thumbnails\*.*";
How to simply delete files in a script ?
-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
How to simply delete files in a script ?
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: How to simply delete files in a script ?
Code: Select all
$dst = "D:\backups\XYplorer_v<xyver> (on <date yyyy-mm-dd>)";
setting "BackgroundFileOps", 0;
copyto $dst, <xypath>, , 2, 2;
delete 0, 0, $dst . "\XYplorer\Data\Thumbnails\*.*";
delete doesn't wait for anything (not until copyto has finished) without backgroundfileops turned offOne of my scripts helped you out? Please donate via Paypal
-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
Re: How to simply delete files in a script ?
Thanks, you helped me againhighend wrote: ↑27 Jan 2021 14:41Code: Select all
$dst = "D:\backups\XYplorer_v<xyver> (on <date yyyy-mm-dd>)"; setting "BackgroundFileOps", 0; copyto $dst, <xypath>, , 2, 2; delete 0, 0, $dst . "\XYplorer\Data\Thumbnails\*.*";deletedoesn't wait for anything (not untilcopytohas finished) withoutbackgroundfileopsturned off
I learned a lot in the past few days and start to love XYplorer even as I long time Total Commander user.
Normaly I do such backups with the ZPAQ archiver which does deduplicating and versioning in the archives.
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: How to simply delete files in a script ?
Why didn't you use it (ZPAQ) this time?
One of my scripts helped you out? Please donate via Paypal
-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
Re: How to simply delete files in a script ?
I did it already as follows in a Batch file
C:\Tools\ZPAQ\zpaq64.exe add D:\Backups\XYplorer.zpaq C:\tools\XYplorer -not C:\Tools\XYplorer\Data\Thumbnails\*
But I wanted one additional simple backup tree before doing some modifications
and also like to play a liitle bit more with YX features.
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: How to simply delete files in a script ?
You discovered another brand-new file manager? oOYX
Just kidding...
One of my scripts helped you out? Please donate via Paypal
-
klownboy
- Posts: 4481
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
Re: How to simply delete files in a script ?
Hi Horst, have you considered using the sync command? It has an option using the "-" to not copy certain folders (e.g., the thumbnail folder). You are copying to new folders based on dates so I'd think it would work in your case. I use as it in a menu situation as follows, but you could adapt it to use your date based target folders.
Code: Select all
sync "D:\Tools\XYplorer", "O:\XYbackup", 1, 0, 1, "c",,"-D:\Tools\XYplorer\*Thumb*\"-
Horst
- Posts: 1419
- Joined: 24 Jan 2021 12:27
- Location: Germany
Re: How to simply delete files in a script ?
Thanks for the tip.klownboy wrote: ↑27 Jan 2021 19:35 Hi Horst, have you considered using the sync command? It has an option using the "-" to not copy certain folders (e.g., the thumbnail folder). You are copying to new folders based on dates so I'd think it would work in your case. I use as it in a menu situation as follows, but you could adapt it to use your date based target folders.Code: Select all
sync "D:\Tools\XYplorer", "O:\XYbackup", 1, 0, 1, "c",,"-D:\Tools\XYplorer\*Thumb*\"
I'll certainly have a look on the Sync function in one of my next scripting plans.
Windows 11 Home, Version 26H2 (OS Build 26300.10075)
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
Portable x64 XYplorer (Actual version, including betas)
Display settings 1920 x 1080 Scale 100%
Everything 1.5.0.1424b (x64), Everything Toolbar 3.5, Listary Pro 7.1.0.47 beta
XYplorer Beta Club