I want to delete files older than certain number of days, based on their names' pattern, using a batch script. I also want to check beforehand, whether the files exist or not. I'm using the following code:
if exist "C:\Users\John\Documents\Week*"
(
forfiles /D -30 /C "cmd /c del C:\Users\John\Documents\Week*"
)
else (exit)
However nothing is happening.