清除電腦垃圾的指令

開啟 cmd command window 

Enter the following command

P.S.: "echo" describes what to do

------通用指令-----

echo ↓ Disk Cleanup window, select all the files you want to delete and click OK 

cleanmgr

pause

echo ↓ Skips the drive selection step and displays the Disk Cleanup settings window. Here, you can select the files to delete.

cleanmgr /sageset

pause

echo ↓ Delete Files Automatically

cleanmgr /sagerun

echo ↓ The Disk Cleanup tool will clean up temporary files older than seven days. However, if you need to clean up temporary folders frequently, you can do so manually or using the command prompt.

cleanmgr /verylowdisk /c

pause

echo ↓ Delete temporary files, there may be no files, but still active in the background for a moment

del  %temp%\*.* /s /q

del /f /s /q %systemdrive%*.tmp

del /f /s /q %systemdrive%*.log 

del /f /s /q %systemdrive%*.chk 

del /f /s /q %systemdrive%*.old 

del /f /s /q %windir%*.bak 

echo ↓ delete Temporary Interenet file by lobin user

del /f /s /q %userprofile%\Local Settings\Temporary Internet Files*.*

------結束-----------

以上留存

Jimmy