How do I stop and restart a BAT file automatically


  1. Posts : 2
    Windows 7 32 Bit Pro
       #1

    How do I stop and restart a BAT file automatically


    Hi,

    I have a bat file that needs to run all the time. Often the app initiated by the bat file, stops working. The developer is working on a solution at the moment, but in the meantime, I'm looking for a workaround.

    Is there any way, I can stop and then initiate the bat file on a timer. NOTE that the app just issues spurious error messages, which is more difficult as I can't just use an application monitoring program.
      My Computer


  2. Posts : 630
    Windows 10 Pro 64 bit
       #2

    Task Scheduler in Administrative Tools should work.
      My Computer


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

    When the batch file starts the program, does it immediately regain control or does it have to wait until the program ends before getting control back. If it has to wait then I don't see any way to do it from within the batch file so an external command started via Scheduler as Lance1 mentioned should do the trick.

    The task would launch another batch file that will terminate the running program using taskkill. That should then return to the original batch file which could either restart the program or just exit and let the 2nd batch file start the initial batch file again.
      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 00:25.
Find Us