Last active
May 26, 2022 16:56
-
-
Save abdmun8/a3a0e26ed0fc988efd3c7b8d04dc2876 to your computer and use it in GitHub Desktop.
Revisions
-
abdmun8 revised this gist
May 26, 2022 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,10 @@ ```cmd ForFiles /p "C:\path\to\folder" /s /d -7 /c "cmd /c del /q @file" ``` or ```cmd ForFiles -p "C:\path\to\folder" -s -m *.bak -d -7 -c "Cmd /C del @FILE" ``` ### Add do task scheduler - Go to action tab -
abdmun8 created this gist
Jan 8, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ ### Delete Files older than 7 days on windows ```cmd ForFiles /p "C:\path\to\folder" /s /d -7 /c "cmd /c del /q @file" ``` ### Add do task scheduler - Go to action tab - On program/script input insert `ForFiles` - On argument input paste the rest of the command - Save