Skip to content

Instantly share code, notes, and snippets.

@maciakl
Created January 13, 2022 15:59
Show Gist options
  • Select an option

  • Save maciakl/96f6b93043aaf78b7a31b6927776d09d to your computer and use it in GitHub Desktop.

Select an option

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
@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