Cut the crap, the direct explosion.
Let's start with a little introduction to the principle.
Windows timed tasks used by the classmates know it has an option ():
The default "Settings" has a drop-down option, we can only use the default "do not start a new instance" to implement the daemon.
At the same time, timed tasks are timed, such as executing once a day, which is equivalent to checking the program once a day and not running. If it is running, and you choose "Do not start a new instance", it means that the original normal running program continues to run, and if the original program does not exist, of course, it is necessary to launch a new instance (this realizes the "guardian" function).
Here are the specific implementation steps:
(1) Create a batch file Call.bat with the following contents:
cd /d E:\solution\FuckACE\ACETest\x64\ReleaseACETest
The above batch processing simple can no longer be simple, the first sentence is to switch the DOS execution directory to the EXE file location, the second sentence is to run the executable program ACETest.exe (where the suffix is not added).
(2) Create a scheduled task
Take Win8 as an example Control Panel management Tool Task Scheduler Task Scheduler Library create a basic task name (the name of your own scheduled Task) next (default "every day" do not change, back again fine) "Next (default every day)" The next step "next" Browse (select your batch file) next finish, right-created Timed task property trigger edit Repeat task interval drop-down select "5 minutes" (select "5 minutes" can also be manually changed to "1 minutes" and so on) "OK" OK "right button" operation. Ok
Note: If there are two batches to guard this exe at the same time, then two EXE will be created, just a reminder. That means you don't have to create multiple scheduled tasks to guard an EXE.
Part of the set:
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Implement daemon = Windows Timer task + batch processing