Use of batch processing [continuously updated]

Source: Internet
Author: User

1. Batch Delete the lyrics automatically downloaded by QQ music

@ Echo off

ECHO is clearing the lyrics file. Please wait ......

Del/f/S/Q "D:/program files/Tencent/qqmusic/qqmusicdata/qqmusiclyric/*. LRC"

Echo: The lyrics file is cleared!

Echo. & pause

 

 

Note:

 

/F force Delete read-only files

/Q specifies the mute status. You are not prompted to confirm deletion.

/S deletes the specified file from the current directory and all its subdirectories. Displays the name of the file being deleted.

 

Add "" to the path ""

 

2. Use environment variables to determine whether a file exists

View environment variables: Take XP as an example. Right-click my computer and choose Properties> advanced> environment variables. You can edit some variables here.

Example 1.

@ Echo off

If exist "% WINDIR %/system32/a.exe" (echo % WINDIR %/system32/a.exe exist) else echo % WINDIR %/system32/a.exe not exist

Pause

 

Example 2.

@ Echo off

If exist "% Temp %/a.exe" (echo a.exe exist) else dir % Temp %

Pause

 

3. Use of Set

@ Echo on

Set Var = "D:/music"

If exist "% var %/ .mp3" (start dir % var %) else ECHO not exist

 


4. Clear the recycle bin

@ Echo off
Echo clear Recycle Bin
Setlocal enabledelayedexpansion
For/F "delims =/" % I in ('fsutil fsinfo drives ^ | find/V "" ') Do (
Set Var = % I
Set drive =! VaR :~ -2!
Fsutil fsinfo drivetype! Drive! | Find "fixed"> NUL &&(
If exist! Drive! /Recycler RD/S/Q! Drive! /Recycler> NUL 2> NUL
If exist! Drive! /Recycled RD/S/Q! Drive! /Recycled> NUL 2> NUL
)
)

Fsutil explanation
,> NUL 2> NUL explanation
, Setlocal

 

5. Clear system garbage

 

@ Echo off
ECHO is clearing the System junk 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 % 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 /*.*"
Del/f/S/Q "D:/favoritevideo /*.*"
Echo system LJ cleared!
Echo. & pause

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.