Use batch processing to clear junk files/automatically shut down/Clear copy viruses

Source: Internet
Author: User
Tags echo 7
Author: Jeffrey. Zhu
Blog: http://blog.csdn.net/gueter/


Before going to bed at night, we often use the shutdown command to shut down eMule. Recently, it was affected by a small program that wanted to automatically shut down the batch processing file! Some experts have done this on the internet, but there is a binding error during the operation, and at cannot be executed, so I made a simplified version myself! Convert BAT to EXE to an EXE file!

Later, the computer junk file cleanup program was added! July

Save the following program to the. txt file, change the. txt file to. bat, and double-click it to run it directly.

Source code:

@ Echo off
Title unlimited version1.3 by Jeffrey (guet)

: Start
CLS
Color 1b
Mode con: Cols = 45 lines = 18
Set TM1 = % time :~ 0, 2%
Set TM2 = % time :~ 3,2%
Set tm3 = % time :~ 6, 2%
Echo % date % TM1 % point % TM2 % minute % tm3 % second
Echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Echo-free operation-...-unlimited operation
Echo.
Select an operation for ECHO, and press ENTER
Echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Echo 0. Clear junk files
Echo 1. Delete copy Virus
Echo 2. Lock the computer
Echo 3. Quick Shutdown
Echo 4. Quick restart
Echo 5. Countdown Shutdown
Echo 6. Countdown restart
Echo 7. logout
Echo 8. Cancel the task
Echo 9. Exit
Echo.

: Cho
Set choice =
Set/P choice = select:
The REM setting variable "choice" is a character entered by the user
If not "% choice %" = "" set choice = % choice :~ 0, 1%
Rem if the input is greater than 1 bit, take 1st bits. For example, if the input is 132, the return value is 1.
Echo.
If/I "% choice %" = "0" Goto delet
If/I "% choice %" = "1" Goto copy.exe
If/I "% choice %" = "2" Goto lock
If/I "% choice %" = "3" Goto shutq
If/I "% choice %" = "4" Goto restart
If/I "% choice %" = "5" Goto outtime
If/I "% choice %" = "6" Goto sethour
If/I "% choice %" = "7" Goto Logoff
If/I "% choice %" = "8" Goto delat
If/I "% choice %" = "9" Goto end

In order to avoid program exceptions caused by null or spaces returned, add double quotation marks outside the variable.
Rem Note: The if statement requires a double equal sign.
Rem if the entered character is not a number above, it will return re-Input
The echo selection is invalid. enter a new one.
Echo.
Goto Cho

: Delet
@ 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 S /*.*
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 /*.*"
Echo.
Echo system spam cleared! Press any key to return to the main menu!
Pause> NUL
Goto start

: Copy.exe
@ Echo off
C:
CD/
Attrib-s-h-r copy.exe
Del copy.exe/F
Attrib-s-h-R *. inf
Del autorun. inf/F
D:
CD/
Attrib-s-h-r copy.exe
Del copy.exe/F
Attrib-s-h-R *. inf
Del autorun. inf/F
E:
CD/
Attrib-s-h-r copy.exe
Del copy.exe/F
Attrib-s-h-R *. inf
Del autorun. inf/F
F:
CD/
Attrib-s-h-r copy.exe
Del copy.exe/F
Attrib-s-h-R *. inf
Del autorun. inf/F
G:
CD/
Attrib-s-h-r copy.exe
Del copy.exe/F
Attrib-s-h-R *. inf
Del autorun. inf/F
Echo.
@ ECHO: the deletion is complete. Press any key to return to the main menu. Remember to manually restart the computer !!
Pause> NUL
Goto start

: Lock
Rundll32.exe user32.dll, lockworkstation
Goto start

: Shutq
CLS
Echo.
Goto start
Shutdown-s-t 0

: Restart
Shutdown-r-t 0

: Outtime
CLS
Echo.
Please input countdown seconds for ECHO
Echo ****************
Echo (to cancel setting, click "OK" and press Ctrl + C twice in a row)
Set timed =
Set/P timed = input:
Shutdown-S-T % timed %
Echo.
The echo computer will be shut down after % timed % seconds. Press any key to return to the main menu...
Pause> NUL
Goto start

: Sethour
Echo.
Please input countdown seconds for ECHO
Echo ****************
Echo (to cancel setting, click "OK" and press Ctrl + C twice in a row)
Set sethour =
Set/P sethour = input:
Shutdown-R-T % sethour %
Echo.
The echo computer will restart after % sethour % seconds. Press any key to return to the main menu...
Pause> NUL
Goto start

: Logoff
Logoff

: Delat
CLS
Echo.
Shutdown-
Echo.
Echo task canceled. Press any key to return to the main menu...
Pause> NUL
Goto start

: End
Echo-free operation-...-unlimited operation
Echo.
Echo Thank you for using Jeffrey's work. Press any key to exit the program.
Pause> NUL
Exit


As follows:

 

 

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.