Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question

closed as off-topic by Ƭᴇcʜιᴇ007, teylyn, AthomSfere, tombull89, gronostaj Jul 16 '13 at 10:22

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they tend to become obsolete quickly. Instead, describe your situation and the specific problem you're trying to solve. Here are a few suggestions on how to properly ask this type of question." – Ƭᴇcʜιᴇ007, teylyn, AthomSfere, tombull89, gronostaj
If this question can be reworded to fit the rules in the help center, please edit the question.

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? –  Werner Henze Jul 15 '13 at 13:47
    
Why would you need to do this, unless @WernerHenze is correct. And then you should either pay up, or move on. –  AthomSfere Jul 16 '13 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. –  Werner Henze Jul 16 '13 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 '13 at 14:18

2 Answers 2

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.

share|improve this answer

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
}
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.