Run disk cleanup regularly.
In addition to temporary files, Windows 10 will produce various unnecessary files after running for a period of time, such as system upgrade patches and residual files after upgrading the old system. These files will take up a lot of space on drive C, and they can be automatically and safely deleted with the help of the "Disk Cleanup" component.
However, by default, running the "Disk Cleanup" component directly will not only delete less junk files, but also require one click to complete the deletion. If you delete files similar to system updates and old system upgrades, you need to manually click "Clean System Files" every time to scan the system again to complete the cleaning. Now, you can automatically clean up with the help of the command line.
Start Notepad, enter the following command and save it as a "clean.bat" batch, and put it on the desktop for later use:
Cleaning Manager /sageset:99
Cleaning Manager /sagerun:99/ Automatic cleaning
Code interpretation:
/sageset:99, which means that sageset displays the disk cleaning settings dialog box and creates a registry key to store the settings selected by the user. 99 indicates the number of specified disk cleanup profiles (usually set to 99). The profile value will be stored in the registry so that it can be called directly the next time the command is used.
/sagerun:99 Run the configuration file set above, so that the system will automatically clean up related projects according to the previous settings after running. /autoclean means automatic cleaning.
In this way, if you want to clean up the junk files on drive C in the future, right-click "clean.bat" on the desktop and select "Run as administrator". After starting batch processing, the disk cleaning settings window will pop up. As you can see, after adding the /sageset:99 parameter, cleaning items will be displayed more than directly running the "Disk Cleaning" component, and there is no "Clean System Files" button (Figure 1).
Check all the items to be cleaned according to the prompt, click OK, so that these selected items will be automatically saved in the registry and configuration file, and then continue to run the command "cleanmgr/sagerun:99/autoclean" (Figure 2).
After the above command runs, it will automatically start scanning and deleting files for disk cleaning. You can see that the scan and clean file windows will pop up on the screen in turn, and all disk junk files will be automatically processed after these operations are completed (Figure 3).
Many junk files in similar systems can also be cleared through the command line. For example, enter "del/f/s/q%systemdrive%". Tmp "deletes all temporary files, and enter" El/f/s/q "%userprofile% \ local settings \ temporary internet files \" to delete all IE temporary buffer files. Because these operations are done through the command line, we can also delete them regularly in combination with the system task plan.
Customize and manage very large files
In addition to the above junk files that can be deleted, drive C will also save some large system files by default. Although it is generally not recommended to delete these files, we can manage them by migration or compression to further reduce the space occupied by C disk.
For the virtual memory file of drive C, you can go to "System Settings → Advanced Properties → Performance Options → Advanced" in turn, and then remove "Automatically manage the paging file size of all drives" to customize the paging file size of drive C (the default size is the same as the memory, for example, users with large memory can set it smaller), or set the paging file to a partition other than drive C (Figure 4).
Similar files include system hibernation files. If you like to use the hibernation function, but feel that it takes up too much space, you can start the command prompt as an administrator and enter "powercfghibernatesize40", where 40 means that the hibernation file size is kept at 40% of the system memory size during hibernation (Figure 5).
In this way, when the system goes into hibernation, the hibernation file will take up less space. Through the comparison before and after compression, we can see that the space occupied by disk C can be greatly reduced after 40% compression (Figure 8). Note, however, that the scaling value cannot be set too small, otherwise Hiberfil. SYS will not be able to sleep because of lack of space. The recommended setting for 4G memory is 60, and the recommended setting for 8G and above is 40-50.
Automatic cleaning of temporary files
Even if it runs normally, it will bring a lot of temporary files, such as the cache brought by downloading software, the cache file brought by play online, and the temporary file brought by the installer. Most temporary files can be deleted. For Windows 10 users (who need to update to the creator's post-1703 version), the system can delete too many temporary files through its own "storage awareness" component.
Enter "storage" in the search box, and set "storage awareness" to "On" in the opened storage settings panel. In this way, once the space of disk C is tight, it can be automatically cleaned by induction (Figure 7).
Of course, we can customize auto-sensing. Click "Change detailed settings" to enter the settings page, and you can set it according to your actual needs. For example, for SSD hard disk users with small C disk space, you can set the running storage awareness cycle to weekly and the temporary file to 14 days, so that the above operations will be automatically performed within the specified cycle (Figure 8).
This paper introduces the setting method of automatic cleaning C disk in Win 10 system. After completing the above operations, we will find that our C disk has been emptied a lot, and downloading other software is also convenient and simple.