none
Schedule a task to run when a particular app is started? RRS feed

  • Question

  • Apologies if this is not the right forum in which to pose this question. Direction is most welcome. (I posted this first at a Win 8.1 Community Forum, and it was suggested that I try at TechNet, without direction as to which forum...)

    I'm running Win 8.1 Is there a way, in Task Scheduler, to trigger a scheduled task to run when a particular app is started?

    Here's my specific situation: I use McAfee Online Backup, which is set to run automatically at 10 PM every day. Sometimes, it has a problem backing up my Outlook pst file if Outlook is running at the time. I usually remember to shut it down at the end of the day, but sometimes forget.

    For now, I've created a batch file that kills Outlook.exe, and I've scheduled a task to run automatically at 9:45 PM. This works. But I'd like to trigger the task to run when MOBK starts. This way, if I change the time of the backup, I don't have to manually change the trigger time for the "Kill Outlook" task.

    I can't find an appropriate trigger in Windows Task Scheduler.

    FWIW, I am not an experienced scripter, but I know my way around Windows pretty well...

    Many thanks!

    Ken

    Ken Isaacson
    www.KenIsaacson.com
    Thursday, January 16, 2014 4:09 PM

Answers

  • Thanks to everyone for their suggestions.

    I guess I'll just continue the course I've been following, which is to have a task shut down OL at a specific time each day, and have MOBK run 15 minutes thereafter.

    Thanks again!

    Thursday, January 16, 2014 8:02 PM

All replies

  • If MOBK writes to the Event Log, then you may be able to use the "On an event" trigger. There may still be some overlap as the MOBK starts and the Outlook task starts and closes Outlook. It's probably worth experimenting.

    Is the MOBK using a scheduled task? If so, you may be able to modify said task to first close Outlook, but you would have likely considered that and MOBK likely uses something else to trigger the backup other than the Task Scheduler. Closing Outlook to free up PSTs has been an issue for years and years. It seems like these products would just use shadow copy, which I believe can handle Outlook being open, or gracefully close applications specified by the user. Good luck!

    Thursday, January 16, 2014 4:27 PM
  • Yeah, the Event Log is the first place I looked, and I haven't been able to find anything. Any idea which folder I might look in (maybe I've been looking in the wrong place).

    I'm not too worried about the overlap you mention, because OL seems to shut down pretty quickly on the kill command.

    MOBK uses its own built-in scheduler, and doesn't run through Windows Task Scheduler, and MOBK's scheduler doesn't allow for "run this program before backing up."

    I'll take another look in the Event Log.

    Many thanks!

    Thursday, January 16, 2014 4:39 PM
  • Contact McAfee for help.  McAfee can be set to use Shadow Copy but you need to be set up on the volume and McAfee needs to be aware of this.  Almost all backup programs use Shadow Copy to copy open files.

    ¯\_(ツ)_/¯

    Thursday, January 16, 2014 4:40 PM
  • schedule it run frequently at every 10 minutes to check for MOBK process is runnig or not. if its running then outlook.exe process will be killed

    Get-process -name 'MOBK'  -ErrorAction silentlycontinue
    if($?)
    {
    kill -Name outlook.exe -force
    }

    I hope this will help your problem

    -Prashanth



    Thursday, January 16, 2014 4:41 PM
  • Yeah, the Event Log is the first place I looked, and I haven't been able to find anything. Any idea which folder I might look in (maybe I've been looking in the wrong place).

    I'm not too worried about the overlap you mention, because OL seems to shut down pretty quickly on the kill command.

    MOBK uses its own built-in scheduler, and doesn't run through Windows Task Scheduler, and MOBK's scheduler doesn't allow for "run this program before backing up."

    I'll take another look in the Event Log.

    Many thanks!


    It seems there would be something written to either the Application or System Event Logs around the time the backup is preparing, or starting to run. Take a look at both logs around 10 p.m. and then look for a consistent event at that time, from day to day. Maybe there's nothing there, but it just seems so unlikely.
    Thursday, January 16, 2014 5:08 PM
  • You will not be able to do what you are trying to do.  It won't work and will be very unreliable.

    Processes are not logged in the EL unless auditing is turned on.


    ¯\_(ツ)_/¯

    Thursday, January 16, 2014 5:16 PM
  • Thanks to everyone for their suggestions.

    I guess I'll just continue the course I've been following, which is to have a task shut down OL at a specific time each day, and have MOBK run 15 minutes thereafter.

    Thanks again!

    Thursday, January 16, 2014 8:02 PM