Re: How to Delete Files in Folder Which Don't Match Files in Another Folder

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Davy" <david@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0-qdnSZ75apcCpvaRVnyjQA@xxxxxxxxxxxxxxxxx

"Pegasus (MVP)" <I.can@xxxxxxx> wrote in message
news:up6aJbyBIHA.4176@xxxxxxxxxxxxxxxxxxxxxxx

"Davy" <david@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:aNydnfM2-MOWcJjanZ2dneKdnZydnZ2d@xxxxxxxxxxxxxxxxx
My digital camera produces both a 'raw' and a jpg version of each
image.
The
file names are identical except for the .raw and .jpg extensions.

I put all the .raw images in a 'RAW' folder and all the jpg images in a
JPG
folder. I browse the jpg folder quickly using Irfanview, deleting poor
images. Then I need to delete equivalent files in the RAW folder.
This
action is error prone if I do it manually so I need a script.

I have a little experience of VBS scripting and would appreciate a
suggestion that might get me started.
I use VBS 6 in Windows 2000.

many thanks in advance,

Davy


You can do this with a single line batch file like so:

@echo off
for %%a in (d:\raw\*.raw) do if not exist d:\jpg\%%~na.jpg echo del %%a

Remove the word "echo" to activate the batch file.

Pegasus,
thanks for that; works beautifully. Although does not work if the file
name
has a space in it but this should not be a problem since the camera
generates file names without spaces,
thanks, Davy



Thanks for the feedback. Did you consider using the standard technique
for dealing with file names that have embedded spaces?

for %%a in (d:\raw\*.raw) do if not exist "d:\jpg\%%~na.jpg" echo del "%%a"


.



Relevant Pages

  • Re: prints from digital camera
    ... I am one of the few people in this NG that feels that JPG is ... okay for the vast majority of what most people shoot. ... reason to shoot RAW, I will, but otherwise its JPG. ... Assuming these 450 images have ...
    (alt.photography)
  • Re: How Do You File Your RAW and JPG Versions?
    ... edited/enhanced TIF or JPG together with the original RAW data. ... If I keep the RAW files in an archive folder then I never ... I copy the photos I ...
    (rec.photo.digital)
  • Re: How to Delete Files in Folder Which Dont Match Files in Another Folder
    ... file names are identical except for the .raw and .jpg extensions. ... I put all the .raw images in a 'RAW' folder and all the jpg images in ... @echo off ...
    (microsoft.public.scripting.vbscript)
  • Re: Anybody just taking jpeg pictures?
    ... The final score was JPG 2, ... The lab I use for this type of work likes good quality images and they ... For the RAW shooters, there is a school of thought that says that it is ...
    (rec.photo.digital)
  • 5DII software
    ... So I've just shot some landscapes and stuff in RAW + jpg format. ... Canon software opened both, as one would expect. ... between the RAW and the jpg images isn't a crack, ...
    (rec.photo.digital.slr-systems)