Purge batch processing of system garbage files (without error enhanced version) _dos/bat

Source: Internet
Author: User
Tags prefetch
"Purge system garbage. Bat", "Clear.bat", "one-click Purge system garbage. Bat", "30 seconds to clear system garbage. Bat", "quickly remove system garbage. Bat"
Basically find the person is a file, but there are many deficiencies or need to improve the place, but most people do not understand DOS commands, so the chances of being changed is very little, the following is the problem I found and improvements, can be said to be a more perfect version.

Found from the Internet, modified a row to resolve the asp+access error: "Microsoft JET Database Engine error ' 80004005 ' Unspecified error"
The rationale for this process is to delete the temporary directory of the system and re-establish it. This process does not add the original permissions of this temporary folder, general procedures are no problem, but the asp+access program will be problematic. If this problem can be resolved: Add Modify permissions to users in this folder

Copy Code code as follows:

rem Temporary files (such as: *.TMP、*._MP) log files (*.log) 、 temporary Help Files (*.gid) 、 disk check files (*.chk) 、 temporary backup files (such as: *.old、*.bak)
REM%systemdrive% is the system disk,%windir% is the system folder,%userprofile% the current user folder, recent is the most recently browsed document
REM del/f/s/q%windir%\prefetch\*.*
REM The above line deletes the "system preloaded" file, generally do not delete
REM rd/s/q%windir%\temp & MD%windir%\temp
REM on one line of operations will change the folder's properties, this property will affect the Asp+access program, so the comment dropped, replaced by the following, the disadvantage is that the folder can not delete the folder, but the files are deleted
REM newly added purge the temporary files generated by MSN "User Experience Improvement Program" under the root directory of C:
REM del/f/a/q%systemdrive%\*.sqm
REM removed, the line below, today in the Control Panel to install DNS prompts to SP2 disc, plug in the CD I made. Seems to have to go to the following folder to find, although the general people will not use, but do not delete this as well.
REM del/f/s/q%windir%\servicepackfiles\*.*
REM removed, the bottom of this line, although the legend is OK, but nothing, does not mean that there will be nothing, the system is often wrong, you can delete the contents of this folder, the system will be rebuilt.
REM del/f/s/q%windir%\softwaredistribution\download\*.*
REM removes this line because: some of the installation information will be put in here, the removal of the software will have a lot of trouble unloading, and, if you are used in the server aspect, these records are absolutely not to delete, the log file is very important.
REM del/f/s/q%systemdrive%\*.log


This is a more classic version, on the basis of online popular on a number of deletions, basically can be said to be the perfect version of the following black background text copied to the text file and then saved as "purge system garbage. Bat", "clear system garbage." Bat ", Clear.bat" and so on, You can read all the names. After you want to clean up the system of garbage directly double-click can be, do not have to find another one.
The following is the most perfect version of the current:

Copy Code code as follows:

@echo off
The Special garbage Clearing tool of the title Liu Yong, is being cleaned up ...
ECHO is clearing the system garbage file, please wait ...
del/f/s/q%systemdrive%\*.tmp
del/f/s/q%SYSTEMDRIVE%\*._MP
del/f/s/q%systemdrive%\*.gid
del/f/s/q%systemdrive%\*.chk
del/f/s/q%systemdrive%\*.old
del/f/s/q%windir%\*.bak
del/f/s/q%windir%\temp\*.*
del/f/a/q%systemdrive%\*.sqm
del/f/s/q%windir%\softwaredistribution\download\*.*
del/f/s/q "%userprofile%\cookies\*.*"
del/f/s/q "%userprofile%\recent\*.*"
del/f/s/q "%userprofile%\local settings\temporary Internet Files\*.*"
del/f/s/q "%USERPROFILE%\Local settings\temp\*.*"
echo clears system junk file complete!
Echo. & Pause


But then we usually use this.

Copy Code code as follows:

@echo off
Color F0
Echo.
Echo is securely cleaning up junk files ...
del/f/q%systemdrive%\*.tmp>nul 2>nul
del/f/q%systemdrive%\*._mp>nul 2>nul
del/f/q%systemdrive%\*.log>nul 2>nul
del/f/q%systemdrive%\*.gid>nul 2>nul
del/f/q%systemdrive%\*.chk>nul 2>nul
del/f/q%systemdrive%\*.old>nul 2>nul
del/f/q%windir%\*.bak>nul 2>nul
del/f/q%windir%\*.tmp>nul 2>nul
del/f/q%windir%\prefetch\*.*>nul 2>nul
del/f/s/q%systemdrive%\recycled\*.*
del/f/q "%allusersprofile%\documents\drwatson\*.*" >nul 2>nul
del/f/q "%userprofile%\cookies\*.txt" >nul 2>nul
del/f/q/s "%temp%\*.*" >nul 2>nul
del/f/q/s "%systemroot%\prefetch\*.*" >nul 2>nul
del/f/q "%userprofile%\recent\*.*" >nul 2>nul
del/f/q "%userprofile%\application Data\microsoft\office\recent\*.lnk" >nul 2>nul
del/f/q/s "%userprofile%\local settings\temp\*.*" >nul 2>nul
RD/S/q%windir%\temp & MD%windir%\temp>nul 2>nul
If not exist%systemroot%\minidump\nul del/f/q/s%systemroot%\minidump\*.*>nul 2>nul
del/f/s/q "%userprofile%\local settings\temporary Internet files\*.*" >nul 2>nul

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.