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.
[ Last edited by clian76 on 2008-11-11 at 18:40 ]
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 ]
Recent Ratings for This Post
( 1 in total)
Click for details
| Rater | Score | Time |
|---|---|---|
| yishanju | -4 | 2008-11-11 18:44 |
Attachments

