How to Automatically Clean up Temp Files at Windows Boot-up

Posted by Britt Duncan - October 10, 2014

Windows will create some junk files when running itself or a process. These stuffs will take up some disk space on the hard drive. While Disk Cleanup, a utility built in Windows, helps to clear system clutters or outdated restore points that we may not need, there are still many temporary files left. Luckily we can configure Windows to automatically remove those unnecessary temporary files so as to make more space on hard drive. Here’s how.

Clean Up Temp Files at Windows Start-up by Creating a Batch File

Option One
Step one- Open Notepad, and type the following in it:

rd %temp% /s /q

md %temp%

Step two- Save the file to the Startup folder, as the path below
%appdata%\microsoft\windows\start menu\programs\startup\cleantemp.bat
Option Two
Step one- Open the Notepad, type in the following: (replace below with your user name, the same in Step four below)
del /s /q “C:\Users\\AppData\Local\Temp\*.*”
Step two- Click File, select Save as
Step three- Name the file as TemKill.bat. And select All Files from Save as type tab. Click Save
Step four- Move the file to the following location: (same: put your account user name in )
C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Done! And now you can restart your computer to check the trick. You’ll find that there are a lot fewer files in the temp folder.

The Previous:
The Next:

Comments are closed.


TESTED:  24 Jun