How to automatically clean the temp folder and free up some space


The temp folder is big in size and is increasing in size all the time due to constant processing. Is it possible to automatically clear the Temp folder from time to time? 


It is possible to create a .bat script file that will automatically clear up temp files with something like the code below. Variable location in the code represents the location to clear (i.e. C:\Users\<username>\AppData\Local\Temp\*.*) 

@echo off
del /S /q location

This .bat can then be used in Windows Task Scheduler to schedule the cleanup. 

Before implementing this, please make sure that the Temp folder does not hold any needed information as the script above will fully clear the folder. It is also suggested to test this out on a different, non-essential folder first. 

Have more questions? Submit a request



Please sign in to leave a comment.