Over time we clutter up our computer with tons of files downloaded over the internet from our browser be it meme files, important documents, one time installers, etc.
With SSD prices still relatively high compared to HDD counter parts, leaving out old files sitting in our downloads folder unused for months or worse years could end up hurting our SSD’s performance in the long run because we end up running out of storage. Here’s a quick and simple way to avoid that by making windows automatically delete old files in your downloads folder.
Buckle up folks, this is a two minute job (at most).
Create a batch file. A batch file is simply a script that’s saved on to a disk. We’ll use this as a starting point.
REM Remove files older than 30 days forfiles /p "C:\Users\YOURUSERNAME\Downloads" /s /m *.* /c "cmd /c Del @path" /d -30
You can adjust it as needed:
- C:\Users\YOURUSERNAME\Downloads – the directory you want to keep clean
- 30 – age of file in number of days
And that’s it. The task won’t run immediately since you set it on a schedule but when it does, you can see that the folder you selected will be cleared out of old files. Pretty neat huh?