markcvrs
Posts: 25
Joined: Tue Apr 21, 2015 9:51 am

Command line for Scheduled Task to close and open application

Hi Guys,

In the Scheduled tasks configuration does anyone know where I can find the command line code to open and close and application. Basically I need to create two tasks. One that opens the application at 7AM and closes the application and 7PM?

Thanks for your help in advance
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Command line for Scheduled Task to close and open application

Hello,

To do so you can create two "Schedule Tasks", first one which will target directly the .exe of your product and second one which will target a .bat file that call the "taskkill" command to kill the application.

You can follow these steps:
1. You should create a .bat file in which you will use the "taskkill" command, an example is

Code: Select all

taskkill /f /im "myApp.exe"
2. Add the created .bat file in "Files and Folder" page
3. Create two schedule tasks: the first is targeting the .exe file of your application and the second one will target the created .bat file.
4. In the "Schedule" tab set the time when to be executed each task.

Please find attached a sample created with Advanced Installer 13.8 which implements this approach.
Sample.zip
(77.31 KiB) Downloaded 338 times
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”