del 命令的參數
/F 強制刪除只讀文件。
/S 從所有子目錄刪除指定文件。
/Q 安靜模式。刪除全局通配符時,不要求確認。
rd 命令的參數
/s 除目錄本身外,還將刪除指定目錄下的所有子目錄和文件。用于刪除目錄樹。
/q 安靜模式
/s 刪除目錄樹時不要求確認。
代碼一
@echo off & title 清理系統垃圾del /f /s /q %systemdrive%/*.tmpdel /f /s /q %systemdrive%/*.mp3del /f /s /q %systemdrive%/recycled/*.*del /f /s /q %windir%/*.bakdel /f /s /q %windir%/prefetch/*.*rd /s /q %windir%/temp & md %windir%/tempdel /f /q %userprofile%/cookies/*.*del /f /s /q "C:/Documents and Settings/Administrator/Local Settings/History"del /f /s /q "C:/Documents and Settings/Administrator/Local Settings/Temporary Internet Files"del /f /s /q "C:/Documents and Settings/Administrator/Local Settings/Temp"del /f /s /q "C:/Documents and Settings/Administrator/Local Settings/Temp/_xl7vss_"del /f /s /q "D:/Program Files/QvodPlayer/Data"
代碼二
@echo off echo 正在清理系統垃圾文件,請稍等...... del /f /s /q %systemdrive%/*.tmp del /f /s /q %systemdrive%/*._mp del /f /s /q %systemdrive%/*.log del /f /s /q %systemdrive%/*.gid del /f /s /q %systemdrive%/*.chk del /f /s /q %systemdrive%/*.old del /f /s /q %systemdrive%/recycled/*.* del /f /s /q %windir%/*.bak del /f /s /q %windir%/prefetch/*.* rd /s /q %windir%/temp & md %windir%/temp del /f /q %userprofile%/cookies/*.* del /f /q %userprofile%/recent/*.* del /f /s /q "%userprofile%/Local Settings/Temporary Internet Files/*.*" del /f /s /q "%userprofile%/Local Settings/Temp/*.*" del /f /s /q "%userprofile%/recent/*.*" echo 清理系統垃圾完成!
然后把上面的內容保存為 清理垃圾批處理.bat,當然大家可以根據自己的需求增減目錄或文件類型即可。
新聞熱點
疑難解答