Conditional file delete script help needed
18:54 01 Jan 2026

So I have a lot of digital image files to delete to save space. The files all have an extension of .ARW. The files that I have already approved and edited also come with an associated .xmp file. The vast majority of these files were rejected and do not have an accompanying .xmp file. So the logic example here is:

If _DSC????.xmp exist do not delete _DSC????.ARW else delete _DSC????.ARW

The range is: _DSC0001.ARW - _DSC9999.ARW

The search and delete should be restricted to just the root directory it's run in and not outside that path

Any help appreciated

delete-file