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