Skip to content

FuLoRi/Cleanup-TempFolder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Cleanup-TempFolder

Description

Recursively scans a user-definable temp folder for files at least as old as a specified age, analyzes the folders to determine which ones to recycle, and then sends the folders followed by the files to the recycle bin.

In determining which folders to recycle, the script only marks ones that are empty or whose contents -- including all subfolders and their files -- are at least as old as the specified age. It only marks the highest-level subfolders that meet those criteria, ensuring that the minimum number of folders are sent to the recycle bin.

Screenshots

WinDirStat showing the number of files and subdirs in the %TEMP% folder prior to running Cleanup-TempFolder: WinDirStat - Before

A PowerShell window showing the script running interactively and the user proceeding with default parameters: Script - Recycle phase

WinDirStat showing the number of files and subdirs in the %TEMP% folder after running Cleanup-TempFolder: WinDirStat - After

Known Issues

Performance is slower than desired due to the recursive nature of the script, and is further slowed when Verbose Output and/or Debug Mode are enabled.

About

Recursively scans a user-definable temp folder for files and folders older than a given age, then sends them to the recycle bin.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors