Automatically cleans up computer garbage and deletes the batch processing for Windows default share letter Bat_dos/bat

Source: Internet
Author: User
by:zuifeng258
Windows is shared more than a few disks by default, and they are hidden dangers.
In DOS, use the command "net share" to view ...
If you can't get a screenshot, you can only type.
Copy Code code as follows:

@echo off
Echo is automatically deleting 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 in the DOS program,
It's in DOS batch processing.
The dos of the 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 shared and ipc$ pipe sharing
If there are not so many disk characters, you can follow the "net Shere *$"/del "* is your disk symbol. To increase or decrease


Copy Code code as follows:

@echo off
echo This is checking cookies, history, etc. directory location (current user) ...
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 here is to clean up the current user's Cookies,ie cache, historical records, etc. ...
for/f "tokens=3*"%%i in (%temp%\cleantmp.txt) do (
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 trash 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 in (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/% 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
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 useless disk error files ...
del/a/f/q "%systemdrive%\*.chk" >nul 2>nul
Dir%systemdrive%\found.??? /ad/b >c:\ temporary garbage. txt
for/f%%i in (c:\ temporary garbage. txt) do rd/q/S "%systemdrive%\%%i" >nul 2>nul

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

echo here is the removal of 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 garbage. 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

I don't know how to say this code, hehe,
I'm not going to explain the code.
Let's talk about how to do this, build a txt text file, enter the code, and change it to the suffix name. bat
Batch file, and then create a shortcut based on it, and put the shortcut in the Start item in the menu bar.
It's OK. Since then, as long as you boot, it runs on its own, after the run will automatically exit
If you want to do it manually, follow it,
Just double-click your batch file when you want to process it.
Finally, the batch processing is very powerful, batch processing commands are not familiar with, very dangerous,,,,,,,
Related Article

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.