Batch File - Match images to Files, delete images when no matching file.

newyears1978

Distinguished
Oct 24, 2011
28
2
18,535
Not sure if this is the right place, but I am trying to write a probably simple batch file that will

Check images in a directory and see if there is a matching rar or zip file with the same name. If there is, it moves on, if there is not it deletes the image.

Images are .jpg and .png

So basically say I had

1.zip
1.jpg

2.zip
2.jpg

3.jpg

4.jpg

It would scan, see that 1 and 2 have zips and images and ignore, but 3 and 4 that it found no matching file it would delete those

Thanks in advance!