You lost me with the number extension. If you strip off the number from the files in FolderA, how will you ever match the names in FolderB where the files presumably still have their numbers?
Otherwise you have three possibilities: Filename is in A, Filename is in B, Filename is in A & B. I try not to post destructive code, so you'll need to replace the
echo statements with
del instructions.
@echo off
for /f "tokens=* delims=" %%v in ('dir c:\FolderA\*.* /b') do (
if exist "c:\FolderB\%%v" echo File %%v in FolderA; File %%v in FolderB
if not exist "c:\FolderB\%%v" echo File %%v in FolderA; File %%v NOT in FolderB
)
for /f "tokens=* delims=" %%v in ('dir c:\FolderB\*.* /b') do (
if exist "c:\FolderA\%%v" echo File %%v in FolderA; File %%v in FolderB
if not exist "c:\FolderA\%%v" echo File %%v NOT in FolderA; File %%v in FolderB
)
As for the number increment, there are worst ways to spend your summer.