1

I am looking for a way to automate the opening and closing of a program based on a timer.

What I am looking for would look like this:

  1. Open program
  2. Run program for 5 minutes
  3. Close program
  4. Do the above again and again
4
  • 4
    As a software developer I must ask you: How about paying the developer for his work and so getting the full version without the limitations? Jul 15, 2013 at 13:47
  • Why would you need to do this, unless @WernerHenze is correct. And then you should either pay up, or move on. Jul 16, 2013 at 4:50
  • @AthomSfere: The original question (you can see it when clicking on Paul's "edited ... ago") was very different from what it looks like now. Mike explicitely talked about a program that only works for some time and that you need to pay if you want the full version. Jul 16, 2013 at 7:12
  • He mentioned that the software developer stated on their website to do this as a workaround. Why? Yeah, I scratched my head on that too. But the actual question behind it was worth an answer, so I edited it to remove the moral aspect and leave the technical aspect of the question. i feel the question as it is now is what he was asking, and is within SU guidelines.
    – Paul
    Jul 18, 2013 at 14:18

2 Answers 2

4

Create a scheduled task using the task scheduler tool. You can specify the start time (every 5 minutes) and set the "Stop task if it runs longer than" box at 5 minutes!

Create a trigger like this: <code>trigger</code> on the scheduled task to start and stop the task.

1

You can do this using the free program autohotkey.

Essentially, you would create a loop consisting of opening the program, setting a timer for x minutes, then closing the program.

You will need to look at the following autohotkey commands:

  1. Loop
  2. SetTimer or Sleep
  3. Run
  4. WinClose

You can also find useful snippets on SuperUser using the autohotkey tag.

Below is a very simple autohotkey script that would need minimal changes on your part to run what you're needing. Lines starting with a semi-colon are comments and can safely be removed:

; Below line keeps this script running until you close it
#Persistent

Loop 
{
    ; Edit the below line to add your program
    Run, C:\Program Files (x86)\Example Program\Example_Program.exe

    ;300000 on the line below is 5 minutes
    Sleep, 10000 

    ; Edit the below line to add your program's "Window Title"
    ; Note this is not the same as the program's name
    WinClose, Example Program
}

Not the answer you're looking for? Browse other questions tagged .