To remove temporary and junk files when starting Windows 10, users need to create a special file in the system that allows intervention and deletion of system files and temporary files causing system clutter. With the trick outlined in this article, temporary files will no longer be a major concern for users, especially since you can completely delete temporary files in Windows 10 without having to manually search for each file to delete.
Setting Up Automatic Deletion of Temporary Files on Windows 10 Startup
*Automatic Deletion of Temporary Files (.tmp) on Windows 10 Startup
Step 1: Open the Notepad application on Windows 10 by pressing the Start button and typing Notepad to quickly find and open the Notepad application on Windows 10. Alternatively, you can also press the Windows + R key combination > type notepad > press Enter to open the application.
Step 2: In Notepad, copy and paste the following code snippet:
rd %temp% /s /q
md %temp%
Step 3: Press File> Save as to save the new file. Alternatively, you can also use the shortcut Ctrl + S to save. Note that in the Save as type section, you need to set the value to All types to save the file in a format compatible with all applications.
Step 4: Enter the filename as follows:
%appdata%microsoftwindowsstart menuprogramsstartupcleantemp.bat
Feel free to copy and paste for convenience.
Step 5: Next, name the Notepad file you just created as: cleantemp.bat.
After creating the file, each time you start the system, this bat file will be tasked with deleting temporary files that consume storage on your computer.
If applications are running, the bat file won't be able to delete the temporary files of those applications. Therefore, you need to close those applications in the Task Manager system manager and proceed to delete the temporary files.
*Disabling Automatic Deletion of Temporary Files (.tmp) on Windows 10
Being a double-edged sword, there are times when you might prefer not to set up automatic deletion of temporary files when starting Windows 10. To disable this feature, simply follow these steps:
Step 1: Open File Explorer by clicking the This PC icon on the desktop or by pressing the Windows + E key combination.
Paste the command below into the address bar, path:
%appdata%microsoftwindowsstart menuprogramsstartup
Step 2: Within that path, delete the previously created bat file. After deletion, the system will no longer automatically delete temporary files when starting Windows 10.
Temporary files on Windows 10 are always a concerning issue, especially for devices with low hard drive capacity. This trick becomes even more useful. Currently, there are many software options to efficiently scan and delete junk files like CCleaner or Clean Master. Among them, CCleaner ranks as one of the most effective PC cleanup software.
That's regarding junk files. As for outdated system files after installing Windows 10, how to handle this clutter and how to delete Windows Old on Windows 10, Mytour has also shared how to delete Windows Old on Win 10 to users, hoping readers will have another solution to optimize disk space on Windows 10.
Windows, integrated with numerous automatic cleanup features, not only deletes temporary files but also schedules the Recycle Bin to automatically clear after 30 days. For more details, you can refer to how Windows 10 automatically clears the Recycle Bin after 30 days, as we have introduced.
