Created
January 13, 2022 15:59
-
-
Save maciakl/96f6b93043aaf78b7a31b6927776d09d to your computer and use it in GitHub Desktop.
Script to clean up your Downloads directory by deleting all files and folders older than 14 days
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| REM Remove files older than 14 days | |
| forfiles /p "C:\Users\lmaciak\Downloads" /s /m *.* /c "cmd /c Del @path" /d -14 | |
| forfiles /p "C:\Users\lmaciak\Downloads" /s /d -14 /c "cmd /c if @isdir == TRUE RMDIR /S /Q @path" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment