I need some help. I thought it was a pretty easy task but ive been trying to solve this all day but to no avail! I have searched through this website trying to adapt my needs but it doesnt work.
So basically I have two folders, folder 1 has all the backup files and folder 2 gets new files put in it. I need a batch file to check if the files in folder 2 have the same name in folder 1...if it does the file should be deleted from folder 2.
Heres how I thought it should be done...so I have a FOR loop with a IF statement which does the checking and if it finds the file EXISTS in folder 1 it DELETES the file from folder 2:
FOR %%a in ("C:\Users\user\Desktop\test\folder1\*.txt") DO IF EXIST "C:\Users\user\Desktop\test\folder2\*.txt" DEL %%a
Any help is appreciated and let me know if i wasnt clear...Thanks guys!