Batch Cleanup System garbage

Source: Internet
Author: User
Tags prefetch

Follow-up Will supplement

1=======================================

@echo off

Title clear rubbish, happy life!

Color 0a

@echo--------------------------------------------------------------------------------

@echo garbage cleanup .....

@echo--------------------------------------------------------------------------------

Del%temp%\*.*/f/s/q/a

Del c:\windows\temp\*.*/f/s/q/a

Del "%userprofile%\cookies\*.txt"/f/s/q/a

Del "%userprofile%\recent\*.*"/f/s/q/a

Del%windir%\prefetch\*.*/f/s/q/a

Del%systemdrive%\recycled\*.*/f/s/q/a

Del%windir%\*.bak/f/s/q/a

Del "%userprofile%\local settings\temporary Internet files\*.*"/f/s/q/a

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

del/f/s/q%systemdrive%\recycled\*.*

del/f/s/q%windir%\*.bak

del/f/s/q%windir%\prefetch\*.*

RD/S/q%windir%\temp & MD%windir%\temp

del/f/q%userprofile%\cookies\*.*

del/f/q%userprofile%\recent\*.*

del/f/s/q "%userprofile%\local settings\temporary Internet files\*.*"

del/f/s/q "%USERPROFILE%\Local settings\temp\*.*"

del/f/s/q "%userprofile%\recent\*.*"

@echo--------------------------------------------------------------------------------

@echo is a good life, rubbish has been cleaned up! Leverage to drop you off!

@echo--------------------------------------------------------------------------------

@echo Pause

2=======================================

@echo off
Echo is cleaning up the system junk file, please wait a moment ...
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
del/f/s/q%systemdrive%\recycled\*.*
del/f/s/q%windir%\*.bak
del/f/s/q%windir%\prefetch\*.*
RD/S/q%windir%\temp & MD%windir%\temp
del/f/q%userprofile%\ Cookie S\*.*
del/f/q%userprofile%\recent\*.*
del/f/s/q "%userprofile%\local settings\temporary Internet files\*.*"
del/f/s/q "%USERPROFILE%\Local settings\temp\*.*"
del/f/s/q "%userprofile%\recent\*.*"
Echo Clear System LJ complete!
Echo. & Pause

3=======================================

Windows by default several disks are shared, and they are hidden dangers.
Under DOS with the command "net share" can view ...
No, you can only type.

Copy CodeThe code is as follows:
@echo off
Echo is automatically removing admin$ management shares and ipc$ pipeline shares.
NET share admin$/del
NET share ipc$/del
NET share C $/del
NET share d$/del
NET share e$/del
NET share f$/del


@echo off is not a DOS program,
But in DOS batches.
The dos of that year, all operations are done with keyboard commands,
When you have to enter the same command every time,
You can save so many commands as a batch.
The above section is the default admin$ command for managing shares and ipc$ pipeline sharing
If there are not so many drive characters, you can follow the "net Shere *$"/del "* is your disk symbol. To increase or decrease


Copy CodeThe code is as follows:
@echo off
echo This is checking cookies, history and other directory locations (current users) ...
Reg QUERY "Hkcu\software\microsoft\windows\currentversion\explorer\shell Folders"/V Cache>%temp%\cleantmp.txt
Reg QUERY "Hkcu\software\microsoft\windows\currentversion\explorer\shell Folders"/V cookies>>%temp%\ Cleantmp.txt
Reg QUERY "Hkcu\software\microsoft\windows\currentversion\explorer\shell Folders"/V history>>%temp%\ Cleantmp.txt
Reg QUERY "Hkcu\software\microsoft\windows\currentversion\explorer\shell Folders"/V nethood>>%temp%\ Cleantmp.txt
Reg QUERY "Hkcu\software\microsoft\windows\currentversion\explorer\shell Folders"/V recent>>%temp%\ Cleantmp.txt

Echo is here to clean up the current user's Cookies,ie cache, history, etc...
for/f "tokens=3*"%%i in (%temp%\cleantmp.txt) does (
FOR/D%%i in ("%%i%%b\*.*") do rd/q/S "%%i" >nul 2>nul
del/a/f/s/q "%%i%%b\*.*" >nul 2>nul
)

echo here to clean up the system temporary junk file ...
del/a/f/s/q "%userprofile%\locals~1\tempor~1\*.*" >nul 2>nul
del/a/f/s/q "%userprofile%\locals~1\temp\*.*" >nul 2>nul
del/a/f/s/q "%userprofile%\cookies\*.*" >nul 2>nul
del/a/f/s/q "%userprofile%\recent\*.*" >nul 2>nul
del/a/f/s/q "%temp%\*.*" >nul 2>nul
del/a/f/s/q "%tmp%\*.*" >nul 2>nul
del/a/f/s/q "%homepath%\. \iconcache.db ">nul 2>nul
del/a/f/s/q "%SYSTEMDRIVE%\DRIVER?\*.PNF" >nul 2>nul
del/a/f/s/q "%systemdrive%\driver?\infcache.1" >nul 2>nul
del/a/f/s/q "%SYSTEMROOT%\*._MP" >nul 2>nul
del/a/f/s/q "%systemroot%\*.bak" >nul 2>nul
del/a/f/s/q "%systemroot%\kb*.log" >nul 2>nul
del/a/f/s/q "%systemroot%\*.dmp" >nul 2>nul
del/a/f/s/q "%systemroot%\*.gid" >nul 2>nul
del/a/f/s/q "%systemroot%\*.old" >nul 2>nul
del/a/f/s/q "%systemroot%\*.query" >nul 2>nul
del/a/f/s/q "%systemroot%\*.tmp" >nul 2>nul
del/a/f/s/q "%systemroot%\inf\infcache.1" >nul 2>nul
del/a/f/s/q "%SYSTEMROOT%\DRIVER?\*.PNF" >nul 2>nul
del/a/f/s/q "%systemroot%\driver?\infcache.1" >nul 2>nul
del/a/f/s/q "%SYSTEMROOT%\INF\*.PNF" >nul 2>nul
del/a/f/s/q "%systemroot%\minidump\*.*" >nul 2>nul
del/a/f/s/q "%systemroot%\prefetch\*.*" >nul 2>nul
For%%i inch (c D E F g h i j k l m n o p q R S t u v w x y z) do del/a/f/q%%i:\autorun.inf%%i:\*.exe & rd/q/S I:\recycler%%i:\recycled
rd/q/S "%programfiles%\installshield installation Information" >nul 2>nul
rd/q/S "%SystemDrive%\Documents and Settings\All Users\Documents\My Boboturbo" >nul 2>nul
rd/q/S "%systemroot%\connection Wizard" >nul 2>nul
rd/q/S "%systemroot%\downloaded Installations" >nul 2>nul
rd/q/S "%systemroot%\help" >nul 2>nul
rd/q/S "%systemroot%\ie7updates" & MD "%systemroot%\ie7updates" >nul 2>nul
rd/q/S "%systemroot%\offline Web Pages" >nul 2>nul
rd/q/S%systemroot%\system32\oobe
rd/q/S "%systemroot%\system32\reinstallbackups" >nul 2>nul
rd/q/S "%systemroot%\softwaredistribution\download" & MD "%systemroot%\softwaredistribution\download" >Nul 2 >nul
rd/q/S "%systemroot%\softwaredistribution\datastore" & MD "%systemroot%\softwaredistribution\datastore" >Nul 2>nul
rd/q/S "%systemroot%\softwaredistribution\eventcache" & MD "%systemroot%\softwaredistribution\eventcache" > Nul 2>nul
rd/q/S "%systemroot%\temp" & MD "%Systemroot%\Temp" >nul 2>nul

echo here is to clean up the useless disk to check the wrong file ...
del/a/f/q "%systemdrive%\*.chk" >nul 2>nul
Dir%systemdrive%\found.??? /ad/b >c:\ temporary waste. txt
For/f%%i in (c + + temporary garbage. txt) do rd/q/S "%systemdrive%\%%i" >nul 2>nul

echo here to clean up the system upgrade patches left by the anti-installation directory ...
Dir%systemroot%\$*$/ad/b >c:\ temporary waste. txt
For/f%%i in (c + + temporary garbage. txt) do rd/q/S "%systemroot%\%%i" >nul 2>nul

Echo is here to clear common software spam items ...
Ren "%programfiles%\common~1\real\update_ob\realsched.exe" Realsched.ex_ >nul 2>nul
Del "%programfiles%\common~1\real\update_ob\realsched.exe" >nul 2>nul
rd/q/S "%programfiles%\tencent\qqgame\download" >nul 2>nul
taskkill/f/im "TIMPlatform.exe"/t >nul 2>nul
del/a/f/s/q "%programfiles%\tencent\qq\timplatform.exe" >nul 2>nul

del/a/f/s/q \ c \ temporary junk. txt

regsvr32/u/s Zipfldr.dll & del/f/s/q%systemroot%\ststem32\zipfldr.dll

copy/y%systemroot%\system32\dllcache\ctfmon.exe D:\
copy/y%systemroot%\system32\dllcache\explorer.exe D:\
copy/y%systemroot%\system32\dllcache\userinit.exe D:\
Sfc/purgecache
copy/y d:\ctfmon.exe%systemroot%\system32\dllcache\ & del/f/q/s D:\ctfmon.exe
copy/y d:\explorer.exe%systemroot%\system32\dllcache\ & del/f/q/s D:\explorer.exe
copy/y d:\userinit.exe%systemroot%\system32\dllcache\ & del/f/q/s D:\userinit.exe
ECHO has completed one-click System garbage Automatic cleaning and system automatic weight loss
Exit


Also do not know this code how to say, hehe,,
I will not explain the code.
Let's talk about this, build a txt text file, enter the code, and change its suffix to. bat
Batch file, and then it creates a shortcut on top of it, putting the shortcut into the Start item in the menu bar.
It's OK. After that, as soon as you turn it on, it runs itself and automatically exits when it finishes running.
If you want to do it manually, do it,
Simply double-click your batch file when you want to process it.
Finally, the batch function is very strong, batch command is not familiar, it is dangerous

Batch Cleanup System garbage

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.