DOS Batch Write a key to clean system garbage BAT code _dos/bat

Source: Internet
Author: User

The parameters of the del command
/F Forces a read-only file to be deleted.
/s Deletes the specified file from all subdirectories.
/q Quiet mode. Confirmation is not required when global wildcard characters are deleted.

Parameters for Rd Command
/s In addition to the directory itself, all subdirectories and files under the specified directory are also deleted. Used to delete a directory tree.
/q Quiet mode
/s does not require confirmation when deleting a tree.

Code A

@echo off & Title cleaning system garbage
del/f/s/q%systemdrive%\*.tmp
del/f/s/q%systemdrive%\*.mp3 del/f/s/q
%s Ystemdrive%\recycled\*.*
del/f/s/q%windir%\*.bak
del/f/s/q%windir%\prefetch\*.* rd/s/
q%windir%\tem P & MD%windir%\temp
del/f/q%userprofile%\cookies\*.*
del/f/s/q "C:\Documents and Settings\administrato R\local settings\history "
del/f/s/q" C:\Documents and Settings\Administrator\Local settings\temporary Internet  Files "
del/f/s/q" C:\Documents and Settings\Administrator\Local settings\temp "
del/f/s/q" C:\Documents and Settings\Administrator\Local Settings\temp\_xl7vss_ "

Code two

@echo off 
Echo is cleaning up the system garbage file, please wait ... 
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%SYSTEMDR 
Ive%\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 
"%use Rprofile%\local settings\temporary Internet files\*.* " 
del/f/s/q" 
%userprofile%\local settings\temp\*.* " del/f/s/q "%userprofile%\recent\*.*" 

Then save the above to clean up the garbage batch. bat, of course, everyone can add or subtract according to their own needs directory or file type.

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.