BAT timing automatic shutdown, BAT automatic End Task shutdown program, DOS automatically end the program after the shutdown _dos/bat

Source: Internet
Author: User

Auto End Program

NTSD is a DOS command that is used to end a dead process that is not going to end in some conventional way.
Use to end a process by entering the following command after you open cmd:
Method One: Use process PID to end process
Command format: ntsd-c q-p pid
command example: Ntsd-c q-p 1332 (end Explorer.exe process)
Example detailed: Explorer.exe PID is 1332, but how to get the process of PID? Enter tasklist under CMD to get PID for all processes in the current task Manager
Method Two: End process with process name
Command format: ntsd-c q-pn ***.exe (***.exe for process name, exe not province)
command example: Ntsd-c Q-PN explorer.exe

Another DOS command to end the process is Taskkill:
Command format: Taskkill/pid 1234/f (the same effect can be achieved.) )

more commonly used , such as: taskkill/f/im Explorer.exe (shutdown Explorer.exe process)

For example:
taskkill/s system/f/im notepad.exe/t
Taskkill/pid 1230/pid 1241/pid 1253/t
taskkill/f/im notepad.exe/im MSPaint.exe
taskkill/f/fi "PID ge 1000"/fi "windowtitle ne untitle*"
taskkill/f/fi "USERNAME eq NT authority\system"/im notepad.exe
taskkill/s system/u domain\username/fi "username ne nt*"/im *
taskkill/s system/u username/p password/fi "imagename eq note*"

taskkill/f/im TEL.exe
taskkill/f/im MT.exe
taskkill/f/im EastFaxServer.exe
taskkill/f/im EastFaxExtPrinter.exe
taskkill/f/im EastFaxService.exe
net stop MSSQLServer

Automatic shutdown

At 22:00 shutdown-s shutdown every 22:00
At 22:00/every:s shutdown-s off at 6 22:00 per week
At 22:00/every:3 shutdown-s 3rd per month 22:00 scheduled shutdown at 21:30 Shutdown-f-R Restarts the computer at 21:30 every day
At 21:30 Shutdown-f-S closes the computer at 21:30 every day with Notepad write down the shutdown-s-T after the play time is OK. If you want to get rid of it, just go straight to the shutdown-a.
That's OK.
Finally, save directly as a. bat file Start menu run type cmd return input shutdown-s-T default 60 seconds off, you need to be timed, as long as a space after the T and then enter a number (time unit is seconds). Cancel timed shutdown: shutdwon-a, answer AddAt/every:4 10:47 Shutdown-f-R can be entered at 4th 10:47 per month for restarting Computer 4
(1-31) If the day of the week can be entered (M, T, W, Th, F, S, Su) 7 days at 21:30/every:w,f,su shutdown-s-f-t 0 answer AddAt 21:30/every:m,t,w,th,f,s,su shutdown-s-f-t 0 Enter in Notepad
echo off
At 23:30 Shutdown-s-F
echo on
Then save it as a batch file and you can have a bat file (such as Aa.bat)
And then put the batch file in the beginning--the program--to start inside.

If you want to shut it down, you lose shutdown-a.

Shutdown other parameters

-I display GUI interface, must be the first option
-L logoff (cannot be used with option-m)
-S shutdown this computer
-R shutdown and restart this computer
-A abort system shutdown
-M \\computername remote computer shutdown/reboot/Abort
-T XX setting the timeout for shutdown is xx seconds
-C "comment" closes comment (maximum 127 characters)
-F forced-run application shutdown without warning
-D [u][p]:xx:yy shutdown reason code

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.