批處理檔案是副檔名為 或的文字檔案,包含一條或多條命令,可以快速地進行批量處理。它使用方便、靈活,功能強大,自動化程度高。那麼它是如何建立的呢?下面為大家簡單介紹一個“清除系統垃圾檔案”的批處理檔案的建立。PS:下圖是批處理檔案建立前後的圖示變化。
操作方法
(01)在桌面滑鼠依次右鍵——>新建——>文字文件;
(02)在記事本中輸入命令:@echo off echo 正在清除系統垃圾檔案,請稍等...... del /f /s /q %systemdrive%* del /f /s /q %systemdrive%*._mp del /f /s /q %systemdrive%* del /f /s /q %systemdrive%* del /f /s /q %systemdrive%* del /f /s /q %systemdrive%* del /f /s /q %systemdrive%recycled*.* del /f /s /q %windir%* 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 SettingsTemporary Internet Files*.*" del /f /s /q "%userprofile%Local SettingsTemp*.*" del /f /s /q "%userprofile%recent*.*" echo 清除系統垃圾完成! echo. & pause
(03)依次點選檔案——>另存為;
(04)將副檔名改為,然後點選確定儲存即可。雙擊建立好的批處理檔案即可清除系統垃圾!
特別提示
儲存時將副檔名改為或者都可以。