相信很多网友电脑里都有这种批处理吧,网上找的一般只几行,我写的这个清理得更全面一点。有附件,可直接下载
功能:
清空所有硬盘分区回收站
删除系统分区里*.tmp *._mp *.gid *.chk *.old。
删除WINODWS目录里的*.log *.bak 。
清空系统堆放垃圾的目录"%windir%\prefetch\*"
清空cookies。
清除最近打开文件记录。
清空WINODWS临时目录。
清除多余的系统自启动项(只留下输入法CTFMON)。
清除IE上网临时文件。
清除系统TEMP文件。
清除开始菜单的使用记录。
清除“运行”“搜索”等使用记录。
@echo off
color 2f
title 系统垃圾清理 clamber 2008/11/11 CMD@XP 282959030@qq.com
echo.&echo 欢迎使用系统垃圾清理!&echo.&echo 清理目标:多余的系统自启动项;清空回收站;IE临时文件;系统临时目录;&echo 系统历史记录;系统垃圾文件。。。
echo.&echo 确认立即清理请按任意键!&pause>nul
title 得到IE和系统临时文件夹目录并清理
for /f "tokens=1,2* delims=:" %%a in ('reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\paths" /v Directory^|find "Directory"') do (set qian=%%a&&set hou=%%~pb)
rd /s /q "%qian:~-1,1%:%hou%" 2>nul
rd /s /q "%temp%" 2>nul
title 得到硬盘分区符并清理各分区回收站
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "固定">nul && (
rd /s /q !drive!\RECYCLER 2>nul||rd /s /q !drive!\Recycled 2>nul
)
)
endlocal
title 清理STARTUP自启动项
del /f /q "%USERPROFILE%\「开始」菜单\程序\启动\*" 2>nul
title 清理系统搜索历史和注册表自启动项
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /va /f 2>nul
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /va /f 2>nul
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru\5603" /va /f 2>nul
reg delete "HKEY_USERS\S-1-5-21-299502267-854245398-682003330-500\Software\Microsoft\Search Assistant\ACMru\5603" /va /f 2>nul
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f 2>nul
reg delete HKEY_USERS\S-1-5-21-299502267-854245398-682003330-500\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f 2>nul
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{75048700-EF1F-11D0-9888-006097DEACF9}\Count /va /f 2>nul
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{5E6AB780-7743-11CF-A12B-00AA004AE837}\Count /va /f 2>nul
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v ctfmon.exe /d %systemdrive%\WINDOWS\system32\ctfmon.exe /f 2>nul
title 清除系统临时和无用文件
del /f /s /q "%systemdrive%\*.tmp" 2>nul
del /f /s /q "%systemdrive%\*._mp" 2>nul
del /f /s /q "%windir%\*.log" 2>nul
del /f /s /q "%systemdrive%\*.gid" 2>nul
del /f /s /q "%systemdrive%\*.chk" 2>nul
del /f /s /q "%systemdrive%\*.old" 2>nul
del /f /s /q "%windir%\*.bak" 2>nul
del /f /s /q "%windir%\prefetch\*" 2>nul
rd /s /q "%windir%\temp"&&md "%windir%\temp" 2>nul
del /f /q "%userprofile%\cookies\*" 2>nul
del /f /q "%userprofile%\recent\*" 2>nul
del /f /s /q "%userprofile%\recent\*" 2>nul
color 5e
title 清理完成!
echo 清理完成!请按任意键退出。。。
pause>nul&taskkill /f /im explorer.exe&start explorer.exe
Last edited by clian76 on 2008-11-11 at 18:40 ]
I believe many netizens have this kind of batch processing in their computers. The ones found online are generally just a few lines. The one I wrote cleans more comprehensively. There is an attachment, which can be downloaded directly.
Function:
Empty the recycle bin of all hard disk partitions.
Delete *.tmp *._mp *.gid *.chk *.old in the system partition.
Delete *.log *.bak in the WINDOWS directory.
Empty the system garbage storage directory "%windir%\prefetch\*".
Empty cookies.
Clear the recently opened file records.
Empty the WINDOWS temporary directory.
Clear the redundant system startup items (only keep the input method CTFMON).
Clear the IE internet temporary files.
Clear the system TEMP files.
Clear the usage records of the start menu.
Clear the usage records of "Run", "Search", etc.
@echo off
color 2f
title System Junk Cleanup clamber 2008/11/11 CMD@XP 282959030@qq.com
echo.&echo Welcome to use System Junk Cleanup!&echo.&echo Cleanup targets: redundant system startup items; empty recycle bin; IE temporary files; system temporary directory;&echo System history records; system junk files...
echo.&echo Press any key to confirm immediate cleanup!&pause>nul
title Get IE and system temporary folder directories and clean up
for /f "tokens=1,2* delims=:" %%a in ('reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Cache\paths" /v Directory^|find "Directory"') do (set qian=%%a&&set hou=%%~pb)
rd /s /q "%qian:~-1,1%:%hou%" 2>nul
rd /s /q "%temp%" 2>nul
title Get hard disk partition letters and clean up recycle bins of each partition
setlocal enabledelayedexpansion
for /f "delims=\" %%i in ('fsutil fsinfo drives^|find /v ""') do (
set var=%%i
set drive=!var:~-2!
fsutil fsinfo drivetype !drive!|find "Fixed">nul && (
rd /s /q !drive!\RECYCLER 2>nul||rd /s /q !drive!\Recycled 2>nul
)
)
endlocal
title Cleanup STARTUP startup items
del /f /q "%USERPROFILE%\「Start」Menu\Programs\Startup\*" 2>nul
title Cleanup system search history and registry startup items
reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /va /f 2>nul
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /va /f 2>nul
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru\5603" /va /f 2>nul
reg delete "HKEY_USERS\S-1-5-21-299502267-854245398-682003330-500\Software\Microsoft\Search Assistant\ACMru\5603" /va /f 2>nul
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f 2>nul
reg delete HKEY_USERS\S-1-5-21-299502267-854245398-682003330-500\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f 2>nul
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{75048700-EF1F-11D0-9888-006097DEACF9}\Count /va /f 2>nul
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{5E6AB780-7743-11CF-A12B-00AA004AE837}\Count /va /f 2>nul
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v ctfmon.exe /d %systemdrive%\WINDOWS\system32\ctfmon.exe /f 2>nul
title Clear system temporary and useless files
del /f /s /q "%systemdrive%\*.tmp" 2>nul
del /f /s /q "%systemdrive%\*._mp" 2>nul
del /f /s /q "%windir%\*.log" 2>nul
del /f /s /q "%systemdrive%\*.gid" 2>nul
del /f /s /q "%systemdrive%\*.chk" 2>nul
del /f /s /q "%systemdrive%\*.old" 2>nul
del /f /s /q "%windir%\*.bak" 2>nul
del /f /s /q "%windir%\prefetch\*" 2>nul
rd /s /q "%windir%\temp"&&md "%windir%\temp" 2>nul
del /f /q "%userprofile%\cookies\*" 2>nul
del /f /q "%userprofile%\recent\*" 2>nul
del /f /s /q "%userprofile%\recent\*" 2>nul
color 5e
title Cleanup completed!
echo Cleanup completed! Press any key to exit...
pause>nul&taskkill /f /im explorer.exe&start explorer.exe
Last edited by clian76 on 2008-11-11 at 18:40 ]