I have huge directories + subdirs containing files on Windows. On the windows command line (or through a script) I'd like to compare two folders and delete files from the subfolder that are not in the main folder.
In the example below the even numbered files should be deleted from the subfolder.
folder: C:\folder1
file1.jpg
file3.jpg
file4.jpg
file7.jpg
file9.jpg
subfolder: C:\folder1\RAW\
file1.CR2
file2.CR2
file3.CR2
file4.CR2
file5.CR2
file6.CR2
file7.CR2
file8.CR2
file9.CR2
I have tried several scripts I found here, but non of them do the job. Any help is appreciated!
Thanks for the input everyone, I came up with a solution also thanks to your input. It works perfect when using it on the command line (Windows of course).
View list before delete:
To delete, remove 'echo'
Hope this will be of use for some out there as well!