File removal by images in another folder?

Messages
1,241
Name
Bal Sanghera
Edit My Images
Yes
Ok this might sound bit confusing but I need some sort of program that will delete 293 photos.

Basically I took a load of photos for a engagement party, and what I normally do is delete the ones that are no good first then run a batch script for a web optimised version.

But this time round I did the optimised version first and deleted the crap pics out of that folder... Which is minus 293 images.

No I cant be bothered to go through all the original again to make sure I delete the same ones, is there anyway I can do this easily and quickly?

Just incase I have confused anyone and didnt make it obvious :LOL: what I am asking... I basically need to remove the exact same images from the original folder so it matches the web optimised folder. :bonk:
 
are the filenames the same between the originals and the optimised folders ?

if so, i have a command that'll do it.
 
anyway, do the following

make a folder on your desktop called "Orig" and copy the contents of your original folder into it (this means you have a backup should stuff go wrong)
make a folder on your desktop called "Optimised" and copy the contents of your optimised folder into it (this means you have a backup should stuff go wrong)

when the copy has finished:

click Start - Run (if you dont have a Run option on your start menu, hold down the Windows key on your keyboard and press the R key)
type cmd and click OK
this'll open a Command Prompt window

type
Code:
forfiles /p %userprofile%\desktop\optimised /c "cmd /c  del %userprofile%\desktop\orig\@file"
and press enter. this will basically step through each and every file in the Optimised folder on your desktop, and for each filename, delete the identically named file from the Orig folder. you then need to delete the contents of your original folder of images, and copy the contents of the Orig folder back to it.

if you understand DOS commands, you're welcome to edit the paths in the above command to reflect the actual locations, but running this on a copy makes more sense.
 
are the filenames the same between the originals and the optimised folders ?

if so, i have a command that'll do it.

Yes all the filename are exactly the same, I have two folders one called 100MSDCF with the original pictures unmodified and Web Optimised with all the images reduced in size by 800px width/height and 293 images deleted. I want the folder called 100MSDCF to have the same pictures in the Web Optimised folder but unmodifed...
 
anyway, do the following

make a folder on your desktop called "Orig" and copy the contents of your original folder into it (this means you have a backup should stuff go wrong)
make a folder on your desktop called "Optimised" and copy the contents of your optimised folder into it (this means you have a backup should stuff go wrong)

when the copy has finished:

click Start - Run (if you dont have a Run option on your start menu, hold down the Windows key on your keyboard and press the R key)
type cmd and click OK
this'll open a Command Prompt window

type
Code:
forfiles /p %userprofile%\desktop\optimised /c "cmd /c  del %userprofile%\desktop\orig\@file"
and press enter. this will basically step through each and every file in the Optimised folder on your desktop, and for each filename, delete the identically named file from the Orig folder. you then need to delete the contents of your original folder of images, and copy the contents of the Orig folder back to it.

if you understand DOS commands, you're welcome to edit the paths in the above command to reflect the actual locations, but running this on a copy makes more sense.

Thanks will give this a try... Going to make copies to my c: as my desktop is pretty muhaha full :LOL:
 
I used
Code:
forfiles /p c:\photos\optimised /c "cmd /c  del c:\photos\orig\@file"
which has deleted all the files I wanted but kept the ones I didnt lol think I must of read your instructions wrong but have I missed a step?

BTW I have backups so its not a major problem, thanks in advanced (TIA) (y)
 
As I read it you can now repeat the process with those unwanted files as the source action on a new copy of your full folder of originals.
 
Sorted now thanks, got two folders with identical images as I wanted the only problem now is the original folder is still over 10gb :LOL: I am either going to have to burn 3dvds or see if theres a cheap 16usb pen for sale. In total including the optimised folder it comes to 11gb of files with 2,262 images.
 
that's weird, because when i run it, it deletes all the files from my Orig folder which exist in the Optimised folder :|

beeeeezzzar !
 
I needed it to do the opposite delete all the files that arent in the optimised folder...
 
aah, gotcha. misunderstood your original request.

in that case, make the script copy/move the ones out of the Original folder that match the files in the Optimised folder to another folder.

that way you end up with a new Original folder, and your existing Optimised folder.

Code:
forfiles /p c:\photos\optimised /c "cmd /c  move c:\photos\orig\@file c:\photos\neworig"
 
Back
Top