Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

CMD: remove files based on date and extension

Hello experts,
I have the following procedure to remove files. I was wondering how to add extension attribute to remove files based on date and specific extension.
If you have questions please contact me.
Thank you.
WITHOUT SUBFOLDERS
ForFiles /p "C:\FolderName" /d -30 /c "cmd /c if @isdir == FALSE del @file"
WITH SUBFOLDERS:
ForFiles /p "C:\FolderName" /d -30 /c /s "cmd /c if @isdir == FALSE del @file"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Luis Diaz

ASKER

Thank you very much Bill!