How to Automatically Delete Temporary Files in Windows Without Software


Temporary files can slow down your system as they pile up over time. By using a simple batch file, you can set your computer to automatically delete these files every time your system starts. Here’s a guide on how to create and use this batch file to clean temp files at every startup.

Steps to Delete Temp Files Automatically at Startup

Step 01: Open Notepad

Press WIN+R to open the Run dialog box, type notepad, and press Enter.

Step 02: Create the Batch File

Copy and paste the following code into Notepad:

rd %temp% /s /q md %temp%

This code will remove all files in the temporary folder and create a fresh temp folder.

Step 03: Save the Batch File to Startup Folder

Save the file with the name cleantemp.bat in your system’s Startup folder. Use the following path to ensure it runs at every startup:

%appdata%microsoftwindowsstart menuprogramsstartupcleantemp.bat
  • Press CTRL+S to save the file.
  • Choose Save as type: All Files and copy the path above in the File name box.

Step 04: Verify or Remove the Batch File

If you want to remove the file from startup later, navigate to the same path using File Explorer:

%appdata%microsoftwindowsstart menuprogramsstartup

Delete the cleantemp.bat file.

Now, every time your system starts, the temporary files will be cleared, improving your system’s performance without manual intervention.

Leave a Comment

Your email address will not be published. Required fields are marked *