|
Advance Member
|
我用的批次檔,和555網兄的類似
忘了從何處來的,不過你可以研究一下,兩個加在一起融會貫通也行
它有註解,應該不難理解各行的動作
-------------------------------------------
@echo 刪除暫存檔案...
@echo off
rem ------- 先改變檔案及資料夾的屬性,不為系統及隱藏屬性
attrib -s -h "%userprofile%\Local Settings\*.*" /d /s
rem ------- 刪除暫存檔案及暫存資料夾
del /q /f /s "%temp%\*.*"
rd /q /s "%temp%"
md "%temp%"
del /q /f /s "%userprofile%\Local Settings\Temp\*.*"
rd /q /s "%userprofile%\Local Settings\Temp"
md "%userprofile%\Local Settings\Temp"
rem ------- 刪除瀏覽網頁暫存檔案,亦可由瀏覽器的設定來刪除 (如Maxthon...)
del /q /f /s "%userprofile%\Cookies\*.*"
del /q /f /s "%userprofile%\Local Settings\History\*.*"
del /q /f /s "%userprofile%\Local Settings\Temporary Internet Files\*.*"
rem ------- 刪除預讀設定檔案,可由更改登錄檔來改變預讀內容
del /q /f /s "%windir%\Prefetch\*.*"
rem ------- 刪除我最近的文件的連結
del /q /f /s "%userprofile%\Recent\*.*"
rem =============================================================================================
rem 使用方法:
rem 1. 把 DelTemp.bat 建立一個捷徑(滑鼠點DelTemp.bat按右鍵,出現功能視窗,選擇建立捷徑)。
rem 2. 把捷徑(捷徑 - DelTemp.bat)的內容打開(點滑鼠右鍵,選內容),會出現一個捷徑內容的視窗,選擇捷徑頁面。
rem 3. 在目標欄位的內容後面加上一個轉導符號至nul。(如 D:\BAT\DelTemp.bat > nul )。
rem ^^^^^ 增加的部份
rem 4. 把執行欄位選擇的內容,選為 "最小化"。
rem 5. 最後把這個捷徑,移到 "C:\Documents and Settings\All Users\「開始」功能表\程式集\啟動" 這個資料夾中。
rem 6. 下次開機時,就會自動清除暫存檔了。
rem
rem Note:
rem 1. 步驟 (3.) 的目的,是把 ECHO 轉導至 nul,不輸出至螢幕上(錯誤及指示訊息除外)。
rem 2. 步驟 (4.) 的目的,是把程式執行時的視窗固定至最小化,不會出現在桌面上。
rem 3. 步驟 (5.) 中,移至 All Users 的目的,是讓所有使用者都可以使用這個功能。
rem
|