Create a batch file to only delete duplicate files (same filename, date/time) in the same relative folder location. New folder\files along with the .bat file are placed here: \TEST\NEW\. Old files are in \TEST\OLD\.
Folder \OLD\ contains many folders that have the same structure as the folder under \NEW\. The intent is to delete all of the duplicate files under \OLD\ which are the same filename, date\time, and relative location in the folder structure.
\TEST\OLD\1\15\1a.txt or \TEST\OLD\3\15\1a.txt would be deleted if \TEST\NEW\1\15\1a.txt existed and has the same date\time.
I started with which does not seem to work -
for %%F in ("d:\test2\new\**") do (
if exist "d:\test2\old\%%~nxF" del "d:\test2\old\%%~nxF"
)