Task Scheduler Trigger @ Program shutdown


  1. Posts : 3
    Windows 7
       #1

    Task Scheduler Trigger @ Program shutdown


    Hello,

    I would like a particular Task to run each time the Firefox application is closed, or, perhaps easier, each time my computer shutdowns.

    But I have no idea how to set up such Trigger.

    Have any of you an idea on how I should proceed?

    Thanks for the help.
      My Computer


  2. Posts : 5,056
    Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86
       #2

    See this thread.

    Run program on shutdown
      My Computer


  3. Posts : 3
    Windows 7
    Thread Starter
       #3

    Thanks for the reply.

    After some test, I realize that I'd rather have the process I'm interested in running start after I quit Firefox. In other words, Firefox shutting down needs to be the trigger that automatically starts the process I'd like to implement.

    Any ideas on the steps I would need to take to make my quitting Firefox the trigger to another program starting? Or have I misread the thread you directed me above?

    Thanks for your help.
      My Computer


  4. Posts : 6,285
    Windows 10 Pro X64
       #4

    I can't find anything but if you can write a small program (may be some available for free from internet) that can monitor a specific process, then you could have this program start whenever you start FireFox by starting a batch file that would first start the monitoring program, then start FireFox. When the program detects FF goes away it could run another batch file which would do whatever you want.

    More ideas here: Batch file to check process - Windows

    This works, just tried it:

    To check if a process is running, you can use the tasklist command. To check if firefox is running, I would use the following command:


    tasklist /FI "IMAGENAME eq firefox.exe" /NH


    which will return (note: extra whitespace is not shown by whirlpool):



    firefox.exe 2660 Console 0 155,476 K


    If a process is not running it will return something like this:



    INFO: No tasks running with the specified criteria.


    If you use this together with a for statement, you could check if the first returned word is the process name (e.g. firefox.exe) or INFO:. I hope that helps a bit. I'll leave the exact syntax for the for statement up to you...
      My Computer


  5. Posts : 3
    Windows 7
    Thread Starter
       #5

    Will look into this and try it. I don't see why it shouldn't work. Thanks a whole lot.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 12:13.
Find Us