Make Task Scheduler run a program after another closes?

Page 3 of 3 FirstFirst 123

  1. Posts : 40
    Win7 x64
       #21

    I have done the above bat file to change the active power scheme because with some programs the pc would go into standby.

    Essentially you can put any number of programs one under the other by copying the 3 lines in tasklist. If *any* of the programs is running it goes to : progon and with powercfg -setactive you select an "always on" power scheme. When none of the programs are running, it goes to : progoff and runs another powercfg -setactive which resets the balanced power scheme with standby timers etc.

    You put it into a task and run it every 10 minutes with system privileges so nothing shows to the user, no cmd popups etc...

    Now to the question in hand. I'm tired of FF going bust at some point and losing my tabs where there is unfinished work, things to read etc. I want to run a batch file that everytime FF closes to back up sessionstore.js in FF profiles.

    The batch is ready, however I need to know when FF closes and after maybe 5 seconds run the batch file *only once* - that's why the above method doesn't work....

    Anyways aparently there;s a FF plugin that does this; it's called session manager. I just installed it; am not sure whether it works or not...
      My Computer


  2. Posts : 4,049
    W7 Ultimate SP1, LM19.2 MATE, W10 Home 1703, W10 Pro 1703 VM, #All 64 bit
    Thread Starter
       #22

    Cmdow?


    silkman said:
    Now to the question in hand. I'm tired of FF going bust at some point and losing my tabs where there is unfinished work, things to read etc. I want to run a batch file that everytime FF closes to back up sessionstore.js in FF profiles.

    The batch is ready, however I need to know when FF closes and after maybe 5 seconds run the batch file *only once* - that's why the above method doesn't work....

    Anyways aparently there;s a FF plugin that does this; it's called session manager. I just installed it; am not sure whether it works or not...
    When that FF problem occurs on my PC, FF doesn't close.
    I can tell this, because the confirmation box in my script doesn't appear (it's waiting for FF to shutdown).
    Killing FF, destroys my session (>95% of the time).
    In my case, there would be no shutdown event.

    I'm not sure when FF updates the session data (I assume it is during the shutdown).

    Have you considered modifying your batch file, so that it backs up the sessionstore.js file at regular intervals?
    I just checked my sessionstore.js file and it seems to update when a tab is opened or refreshed.

    You'd have to edit the file to add some closing statements.
    Copy the file before you start FF and then start FF and compare the 2 files to see what I mean.

    Have you considered modifying your batch file, so that it backs up the sessionstore.js and sessionstore.bak files and then closes FF?
    That is to say, use a batch file to close FF.

    I found this info (it's from 2007 though)
    Cmdow.exe a really excellent command line tool for manipulating windows can do a normal close window command that could be used to cause firefox or any program to shutdown normally.
    This would be a preferred method of shuting down firefox from the command line over the brute force kill method. Cmdow is a free program and can be downloaded from various sites. Its home site is in the UK I believe. Just google cmdow and you should be able to find it.
    Here are some links:

    CMDOW Commandline Window Utility for NT4/2000/XP/2003

    cmdow.exe - What is cmdow.exe?
    Last edited by lehnerus2000; 19 Apr 2012 at 19:48. Reason: Additional
      My Computer


 
Page 3 of 3 FirstFirst 123

  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 19:14.
Find Us