Skip to content

Instantly share code, notes, and snippets.

@soft2help
Created August 31, 2021 14:34
Show Gist options
  • Select an option

  • Save soft2help/6d24745c6c7f4c66d7f0068b219bf383 to your computer and use it in GitHub Desktop.

Select an option

Save soft2help/6d24745c6c7f4c66d7f0068b219bf383 to your computer and use it in GitHub Desktop.
Windows batch delete Files More Older Than X Days
set folder = "C:\tmp"
set fileExtension = ".txt"
set daysOlder = 90
forfiles -p %folder% -s -m *%fileExtension% /D -%daysOlder% /C "cmd /c del @path"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment