On the setting tab in the standard Windows task scheduler there is an option to stop the task if it runs for a given length of time.
It works. I used to use it with notepad and a todo.txt file. I set the task to run for three minutes after bootup. If I edited the file within the three minutes it would prompt me to save before closing. Otherwise, it would just close notepad.