Disk Defragmenter

  

The computer will inevitably experience performance degradation after long-term use, because the use of the application will produce a lot of disk fragment files and some temporary files or cache files, which will inevitably lead to a decline in disk utilization. In order to keep the computer running more smoothly, we need to regularly defragment the disk and clean up the junk files. Today our topic is to automate the cleaning and defragmentation of junk files.

The following batches can help us clean up temporary files and useless logs or backup files on the system.

del /f /s /q %systemdrive%*.tmpdel /f /s /q %systemdrive%*._mpdel /f /s /q %systemdrive%*.logdel /f /s /q % Systemdrive%*.giddel /f /s /q %systemdrive%*.chkdel /f /s /q %systemdrive%*.olddel /f /s /q %systemdrive%recycled*.*del /f /s /q % Windir%prefetch*.*rd /s /q %windir%temp & md %windir%tempdel /f /q %userprofile%cookies*.*del /f /q %userprofile%recent*.*del /f /s /q %userprofile%Local SettingsTemporary Internet Files*.*del /f /s /q %userprofile%Local SettingsTemp*.*del /f /s /q %userprofile%recent*.*

Clean up in the system After completion, we need to call the Defrag command to defragment the disk. For example, to defragment the C drive, we only need to execute:

C:>defrag c: -v -f > c:defrag.txt

The command is fine. The -f parameter means defragmentation if there is not enough disk space. The -v parameter refers to a detailed description of the sorted disk status results. Then I use the > symbol to redirect the results to a defrag.txt file for viewing.

With the above two command line disk cleanup and defragmentation, we can perform regular execution through the mission plan. Instead of using us to do it manually.

Copyright © Windows knowledge All Rights Reserved