Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Automatic delete files or folders matching a search term

WinSCP scripting does not support recursive delete with file mask.

EDIT 2024: You would have to use WinSCP .NET assembly, e.g. from PowerShell script.
https://winscp.net/eng/docs/library
mooya

Automatic delete files or folders matching a search term

Hi,

I'm running a sync job from a NAS to a External drive which runs perfect.
I want as less garbage on the external drive as possible. When i open the drive on a Windows PC it creates thumbs.db files and when i open the drive on a mac it also creates certain files.

I want to create a Clean.bat file which deletes these files and folders.

How can I use the rm command to delete all files matching a search term? (in multiple sub-folders)

Thank you,
Mooya