失落的紀錄

2011-05-24

批次檔-清除系統垃圾文件

分類: 批次相關 — 番茄 @ 23:15

@echo off
echo 終止程序 explorer.exe
TASKKILL /F /Im explorer.exe

echo 正在清除 %systemdrive% 碟根目錄的垃圾文件,請稍等……
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

echo 正在清除 %windir% 目錄的系統垃圾文件,請稍等……
del /f /s /q %windir%*.bak

echo 正在清除 %systemdrive%RECYCLER 目錄的垃圾文件,請稍等……
rd /s /q %systemdrive%RECYCLER & md %systemdrive%RECYCLER
attrib +s +h %systemdrive%RECYCLER

echo 正在清除 %windir%prefetch 目錄的垃圾文件,請稍等……
rd /s /q %windir%prefetch & md %windir%prefetch

echo 正在清除 %windir%temp 目錄的垃圾文件,請稍等……
rd /s /q %windir%temp & md %windir%temp

echo 正在清除 "%userprofile%Local SettingsTemp" 目錄的垃圾文件,請稍等……
rd /s /q "%userprofile%Local SettingsTemp" & md "%userprofile%Local SettingsTemp"

echo 正在清除 Cookies ,請稍等……
rd /s /q "%userprofile%Cookies" & md "%userprofile%Cookies"
attrib +s "%userprofile%Cookies"

echo 正在清除 %userprofile%Recent 目錄的垃圾文件,請稍等……
del /f /q /a "%userprofile%Recent*.*"

echo 正在清除 Temporary Internet Files 的垃圾文件,請稍等……
rd /s /q "%userprofile%Local SettingsTemporary Internet Files"
md "%userprofile%Local SettingsTemporary Internet Files"
pause

echo 確認目錄有被建立
@echo on
attrib %systemdrive%RECYCLER
attrib %windir%prefetch
attrib %windir%temp
attrib "%userprofile%Local SettingsTemp"
attrib "%userprofile%Cookies"
attrib "%userprofile%Local SettingsTemporary Internet Files"
@echo off
pause

echo 清除系統垃圾檔案完成!
echo 接下來將將進行關機,如果不想關機請按 Ctrl + C 終止程式
echo. & pause
shutdown.exe -s -f -t 0
==============================================
@echo off
echo 終止程序 explorer.exe
TASKKILL /F /Im explorer.exe

echo 正在清除 %systemdrive% 碟根目錄的垃圾文件,請稍等……
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

echo 正在清除 %windir% 目錄的系統垃圾文件,請稍等……
del /f /s /q %windir%*.bak

echo 正在清除 %systemdrive%RECYCLER 目錄的垃圾文件,請稍等……
rd /s /q %systemdrive%RECYCLER & md %systemdrive%RECYCLER
attrib +s +h %systemdrive%RECYCLER

echo 正在清除 %windir%prefetch 目錄的垃圾文件,請稍等……
rd /s /q %windir%prefetch & md %windir%prefetch

echo 正在清除 %windir%temp 目錄的垃圾文件,請稍等……
rd /s /q %windir%temp & md %windir%temp

echo 正在清除 "%userprofile%Local SettingsTemp" 目錄的垃圾文件,請稍等……
rd /s /q "%userprofile%Local SettingsTemp" & md "%userprofile%Local SettingsTemp"

echo 正在清除 Cookies ,請稍等……
rd /s /q "%userprofile%Cookies" & md "%userprofile%Cookies"
attrib +s "%userprofile%Cookies"

echo 正在清除 %userprofile%Recent 目錄的垃圾文件,請稍等……
del /f /q /a "%userprofile%Recent*.*"

echo 正在清除 Temporary Internet Files 的垃圾文件,請稍等……
rd /s /q "%userprofile%Local SettingsTemporary Internet Files"
md "%userprofile%Local SettingsTemporary Internet Files"
pause

echo 確認目錄有被建立
@echo on
attrib %systemdrive%RECYCLER
attrib %windir%prefetch
attrib %windir%temp
attrib "%userprofile%Local SettingsTemp"
attrib "%userprofile%Cookies"
attrib "%userprofile%Local SettingsTemporary Internet Files"
echo 啟動 explorer.exe 檔
@echo off
pause
cd
cd windows
explorer.exe
==============================================
@echo off
echo 終止程序 explorer.exe
TASKKILL /F /Im explorer.exe

echo 正在清除 %systemdrive% 碟根目錄的垃圾文件,請稍等……
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

echo 正在清除 %windir% 目錄的系統垃圾文件,請稍等……
del /f /s /q %windir%*.bak

echo 正在清除 %systemdrive%RECYCLER 目錄的垃圾文件,請稍等……
rd /s /q %systemdrive%RECYCLER & md %systemdrive%RECYCLER
attrib +s +h %systemdrive%RECYCLER

echo 正在清除 %windir%prefetch 目錄的垃圾文件,請稍等……
rd /s /q %windir%prefetch & md %windir%prefetch

echo 正在清除 %windir%temp 目錄的垃圾文件,請稍等……
rd /s /q %windir%temp & md %windir%temp

echo 正在清除 "%userprofile%Local SettingsTemp" 目錄的垃圾文件,請稍等……
rd /s /q "%userprofile%Local SettingsTemp" & md "%userprofile%Local SettingsTemp"

echo 正在清除 Cookies ,請稍等……
rd /s /q "%userprofile%Cookies" & md "%userprofile%Cookies"
attrib +s "%userprofile%Cookies"

echo 正在清除 %userprofile%Recent 目錄的垃圾文件,請稍等……
del /f /q /a "%userprofile%Recent*.*"

echo 正在清除 Temporary Internet Files 的垃圾文件,請稍等……
rd /s /q "%userprofile%Local SettingsTemporary Internet Files"
md "%userprofile%Local SettingsTemporary Internet Files"
pause

echo 確認目錄有被建立
@echo on
attrib %systemdrive%RECYCLER
attrib %windir%prefetch
attrib %windir%temp
attrib "%userprofile%Local SettingsTemp"
attrib "%userprofile%Cookies"
attrib "%userprofile%Local SettingsTemporary Internet Files"
@echo off
pause

echo 清除系統垃圾檔案完成!
echo 接下來將將進行關機,如果不想關機請按 Ctrl + C 終止程式
echo. & pause
shutdown.exe -r -f -t 0

無迴響

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress