Windows systems often accumulate temporary files and other unnecessary items that consume space on your hard drive. We've previously discussed multiple methods to tidy up your system using tools like Disk Cleanup or third-party utilities such as CCleaner. Most of these techniques typically清理Temp folder, but it's beneficial to keep that folder as clean as possible.
This article will guide you on how to automatically delete temporary files, whether they originate from apps, the recycle bin, or the download folder. Simply follow the steps detailed below, and you'll be able to configure your system to automatically remove temporary files.
Regardless of whether you're using Windows 7 or Windows 10, you can automatically delete temporary files by creating a batch file. Clearing out the Temp file can free up a significant amount of space on your hard drive. If you shut down your PC every night, you can safely delete the temp files from the previous day during the boot process.
1. Open Notepad and type in the following:
rd %temp% /s /q translates to "Remove (delete) the temporary directory and all its contents recursively and quietly in command prompt."
"md %temp%" is a command in Command Prompt (CMD) in Windows, which creates a directory named "temp" in the current user's temporary folder. In English, it would be: "mkdir %temp%" (mkdir stands for "make directory"). This command is used to create a temporary folder for storing files during computer operations. The "%temp%" variable automatically resolves to the system's designated temporary folder path.
2. Now, save the file exactly with the following path:
%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\CleanTemp.bat
This will create your batch file and save it within the Startup folder.
After creating the batch file, you can reboot your PC, and when you open the Temp folder, you'll notice that there are significantly fewer files than before.
With the Windows 10 Fall Creators Update (version 1709), Microsoft introduced a new feature in Storage Sense that allows for the automatic deletion of files from the Downloads folder or removal of unused temp files. When enabled (which is disabled by default), this feature will automatically remove unmodified files and temporary files from the Downloads folder or the Recycling Bin after 30 days.
Step 1. Open the Settings app. Navigate to System > Storage.
Step 2. In the Storage sense section, toggle the Storage sense feature on by sliding the switch to the on position.
Step 3. Click the "Change how we free up space" link. Ensure that the Storage Sense feature is turned on, as mentioned in the first step.
Step 4. Enable the option to delete temporary files that my apps aren't using.
Your Windows 10 will then be able to delete temp files or other files automatically.
If you accidentally delete important files on your Windows 10/8/7, there's still a possibility to retrieve them. You can utilize a data recovery software for assistance. This tool offers a free option to recover up to 2GB of files. Simply download it directly from this link and easily recover automatically deleted files.
Step 1. Choose a location and begin scanning
Launch the Data Recovery Wizard tool, hover over the partition or drive where the deleted files were originally stored. Click on "Scan" to search for the lost files.
Step 2. Select the files you want to recover Choose the files you wish to restore.
Once the scan is complete, select the deleted files you wish to recover. You can click on the filter option to display only the specific file types you're interested in. If you recall the file name, you can also utilize the "Search files or folders" box, which is the quickest method to locate the target file.
Step 3. Preview and recover deleted files
Preview the recoverable files. Next, select the files you wish to restore and click "Recover" to save them to a new storage location, rather than the disk where the data was originally lost.