Automatically clear computer junk and delete batchcompute for Windows default shared drive letter

Source: Internet
Author: User

By: zuifeng258
By default, Windows shares multiple disks, which are hidden.
In dos, run the "net share" command...
No, you can only type. CopyCode The Code is as follows: @ echo off
ECHO is automatically deleting admin $ management share and IPC $ MPs queue share,
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 DOS Program , but in DOS batch processing.
in the current DoS, all operations were completed using keyboard commands.
every time you enter the same command,
you can save so many commands as one batch.
the above section is the default admin $ Management Sharing and IPC $ pipeline sharing command
if there are not so many drive letters, the above "net shere * $"/del '* is your disk symbol. Increase or decrease

Copy codeThe Code is as follows: @ echo off
ECHO is checking the directory location (current user) such as cookies and historical records )......
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

Here, Echo clears cookies, ie caches, and historical records of the current user ......
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, we need to clear temporary junk files ......
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/S % I: \ recycler % I: \ recycled
RD/Q/s "% ProgramFiles % \ InstallShield installation information"> NUL 2> NUL
RD/Q/s "% systemdrive % \ Documents ents and Settings \ All Users \ Documents ents \ My boturbo"> 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 clear useless disk error files ......
Del/A/f/Q "% systemdrive % \ *. Chk"> NUL 2> NUL
Dir % systemdrive % \ found .??? /AD/B> C: \ empty garbage .txt
For/F % I in (c: \ Taobao garbage .txt) do RD/Q/s "% systemdrive % \ % I"> NUL 2> NUL

Echo here, we will clean up the reverse installation directory after the system upgrade patch ......
Dir % SystemRoot % \ $ * $/AD/B> C: \ Uninstall garbage .txt
For/F % I in (c: \ Taobao garbage .txt) do RD/Q/s "% SystemRoot % \ % I"> NUL 2> NUL

Echo here is to clear common software spam projects ......
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: \ parse 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 \ assumer.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 Automatic Cleaning of system spam and automatic weight loss.
Exit

I don't know how to say this code ,,
I will not explain the code ..
Let's talk about this. Create a TXT text file, input the code, and change its suffix to. bat.
And then create a shortcut Based on the shortcut. Put the shortcut in the Start item on the menu bar.
OK. After that, as long as you start the system, it runs on its own and automatically exits after running.
If you want to do this manually,
Double-click your batch file when you want to process it.
Finally, the batch processing function is very powerful. Do not use batch processing commands unless you are familiar with them. It is 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.