I want to delete
extensionless files older than 7
days whose names end with _C
.
Example files:
B_C_A1_C B_C_A2_C B_C_A3_A test.txt
My code:
SET mypath=%cd%\downloads
ForFiles /p %mypath% /d -7 /c "cmd /c del /q %mypath%\*_C
When I execute the code, it deletes all files which contains _C
, but I want to delete only files which end with _C
and are older than 7
days.
How can I fix this?