HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: Dirki on 2013-01-15 07:44:36

Title: Close a program with Scheduler?
Post by: Dirki on 2013-01-15 07:44:36
Can I make the Scheduler close a program, e.g. Thunderbird at a special time?
Title: Close a program with Scheduler?
Post by: trout on 2013-01-15 15:28:08
Using the "Launch application" action, which is basically running a system command prompt, you have some options.

Ideally, if the program has available a command line switch to close it, then you can just "launch" the program EXE with the termination switch (e.g. "Program.exe -exit"). But most programs do not have such a command.

Alternatively, since "Launch application" is a command line process, you can enter a command to kill the system process. BUT this is usually not a good idea because it is not a clean shutdown. It is basically like the program has crashed, with all the consequences thereof. So for example, you could launch "TASKKILL /f /im thunderbird.exe /t" - which will forcefully close Thunderbird ...but you probably will not like the result.

Better than killing the process would be to find a third-party tool which you could launch to cleanly close the program.
Title: Close a program with Scheduler?
Post by: Dirki on 2013-01-15 15:54:29
Many thanks, trout,

I wouldn't have the idea, that using the "Launch application" you can shut down a program.

Quote
Ideally, if the program has available a command line switch to close it, then you can just "launch" the program EXE with the termination switch (e.g. "Program.exe -exit"). But most programs do not have such a command.

I have just tried, that doesn't work. I have added this line: "I:\Thunderbird\App\Thunderbird\thunderbird.exe  -exit" in "Launch application".

Quote
Alternatively, since "Launch application" is a command line process, you can enter a command to kill the system process. BUT this is usually not a good idea because it is not a clean shutdown. It is basically like the program has crashed, with all the consequences thereof. So for example, you could launch "TASKKILL /f /im thunderbird.exe /t" - which will forcefully close Thunderbird ...but you probably will not like the result.

Yes, indeed, that doesn't seem to be the best choice.

Quote
Better than killing the process would be to find a third-party tool which you could launch to cleanly close the program.

Okay, I will try to find one.

Many thanks again.