OK論壇

 找回密碼
 註冊
查看: 1471|回復: 0

<轉貼>60秒清除windows xp硬碟幾百mb的暫存檔

[複製鏈接]
  • TA的每日心情
    開心
    2012-10-14 12:03 AM
  • 簽到天數: 10 天

    連續簽到: 2 天

    [LV.3]偶爾看看II

    發表於 2011-5-29 20:14:57 | 顯示全部樓層 |閱讀模式
    是否注意到你的電腦C槽的可用空間正在一天天在減少呢?是不是動作一天比一天遲緩呢?

    在Windows在安裝和使用過程中都會產生相當多的垃圾文件,包括臨時文件(如:*.tmp、*._mp)日誌文件(*.log)、臨時幫助文件(*.gid)、磁碟檢查文件(*.chk)、臨時備份文件(如:*.old、*.bak)以及其他臨時文件。特別是如果一段時間不清理IE的臨時文件夾「Temporary Internet Files」,其中的緩存文件有時會佔用上百MB的磁盤空間。這些文件不僅僅浪費了寶貴的磁盤空間,嚴重時還會使系統運行慢如蝸牛。現在就讓我們一起來快速清除系統垃圾吧!!

    下面是步驟很簡單就兩步!

    打開「記事本」,把下面的字複製進去,點「另存為」,把文件名定為「clean.bat」就完成,記住後副檔名一定要是.bat,好ok了!你的垃圾清除器就這樣製作成功了!雙擊它就能很快地清理垃圾文件,大約一分鐘不到。

    複製下面兩虛線------------------間的字(不含虛線):
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    @For /F "tokens=1,2,3,4 delims=/ " %%A in ('Date /t') do @(
            Set Year=%%A
            Set Month=%%B
            Set Day=%%C
            Set Week=%%D
    )

    @echo %Year%%Month%%Day%.log

    @echo off
    echo 建立清除記錄檔  %Year%%Month%%Day%.log
    echo 正在清除系統垃圾文件,請稍等......
    echo dir %systemdrive% (清理前) > %Year%%Month%%Day%.log
    echo. >> %Year%%Month%%Day%.log
    dir %systemdrive% >> %Year%%Month%%Day%.log
    echo. >> %Year%%Month%%Day%.log
    echo =========================================================== >> %Year%%Month%%Day%.log
    del /f /s /q %systemdrive%\*.tmp  >>%Year%%Month%%Day%.log
    del /f /s /q %systemdrive%\*._mp  >>%Year%%Month%%Day%.log
    del /f /s /q %systemdrive%\*.log   >>%Year%%Month%%Day%.log
    del /f /s /q %systemdrive%\*.gid   >>%Year%%Month%%Day%.log
    del /f /s /q %systemdrive%\*.chk   >>%Year%%Month%%Day%.log
    del /f /s /q %systemdrive%\*.old   >>%Year%%Month%%Day%.log
    del /f /s /q %systemdrive%\recycled\*.*   >>%Year%%Month%%Day%.log
    del /f /s /q %windir%\*.bak   >>%Year%%Month%%Day%.log
    del /f /s /q %windir%\prefetch\*.*   >>%Year%%Month%%Day%.log
    rd /s /q %windir%\temp & md %windir%\temp   >>%Year%%Month%%Day%.log
    del /f /q %userprofile%\cookies\*.*   >>%Year%%Month%%Day%.log
    del /f /q %userprofile%\recent\*.*   >>%Year%%Month%%Day%.log
    del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"   >>%Year%%Month%%Day%.log
    del /f /s /q "%userprofile%\Local Settings\Temp\*.*"   >>%Year%%Month%%Day%.log
    del /f /s /q "%userprofile%\recent\*.*"   >>%Year%%Month%%Day%.log
    echo 清除系統垃圾完成!
    echo 系統垃圾清除記錄, 請參閱 %Year%%Month%%Day%.log
    echo. >> %Year%%Month%%Day%.log
    echo =========================================================== >> %Year%%Month%%Day%.log
    echo dir %systemdrive% (清理後) >> %Year%%Month%%Day%.log
    echo. >> %Year%%Month%%Day%.log
    dir %systemdrive% >> %Year%%Month%%Day%.log
    echo. & pause
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    複製上面兩虛線----------------間的字(不含虛線):

    以後只要雙擊運行該文件,當螢幕提示「清除系統垃圾完成!就還你一個「苗條」的系統了!!
    到時候再看看你的電腦log檔,是不是節省了幾百mb的空間呢?

    解釋:

    這只是一個把刪除的指令作成批次的檔型式
    %Year%%Month%%Day%.log  
    這段字串只是要產生一個記錄檔 , 如 20070226.log  (沒需要可以事後手動刪除)

    dir
    可比較清除前, 清除後的檔案空間

    del /f /s /q %systemdrive%*.tmp
    刪除磁碟中副檔名為TMP的暫存檔案

    del /f /s /q %systemdrive%*._mp
    刪除磁碟中副檔名為_MP的暫存檔案

    del /f /s /q %systemdrive%*.log
    刪除磁碟中副檔名為LOG的紀錄檔案

    del /f /s /q %systemdrive%*.gid
    刪除磁碟中副檔名為GID的暫存檔案

    del /f /s /q %systemdrive%*.chk
    刪除磁碟中副檔名為CHK的暫存檔案( 這個都是磁碟掃描之後的檔案基本上沒什麼作用 )

    del /f /s /q %systemdrive%*.old
    刪除磁碟中副檔名為OLD的備份檔案

    del /f /s /q %systemdrive%recycled*.*
    刪除磁碟中資源回收筒的所有檔案

    del /f /s /q %windir%*.bak
    刪除磁碟中副檔名為BAK的備份檔案

    del /f /s /q %windir%prefetch*.*
    rd /s /q %windir%temp & md %windir%tempdel /f /q %userprofile%cookies*.*
    del /f /q %userprofile%recent*.*
    刪除userprofile回收筒的所有檔案

    del /f /s /q "%userprofile%Local SettingsTemporary Internet Files*.*"
    刪除所有瀏覽器的暫存檔案
    del /f /s /q "%userprofile%Local SettingsTemp*.*"
    刪除暫存資料夾裡的所有檔案

    所以基本上他批次檔寫的內容都是刪除一些沒用的東西, 真的可以讓你的硬碟多不少空間。

    轉自 : http://micksex.com/bbs/viewthread.php?tid=270127&extra=page%3D1
    回復

    使用道具 舉報

    您需要登錄後才可以回帖 登錄 | 註冊

    本版積分規則

    Archiver|手機版|小黑屋|OK討論區

    GMT+8, 2024-4-25 09:59 PM , Processed in 0.050231 second(s), 19 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回復 返回頂部 返回列表