Launch program with timeout

Discuss RoboTask here
Post Reply
Vara04
Posts: 54
Joined: Fri Feb 24, 2012 8:02 pm
Location: France

Launch program with timeout

Post by Vara04 »

I do not see how to launch a program and set a timeout.

What I want to do, is to run a program :
- if the program ended before a time defined, I want to retrieve the return code of the program,
- else, I want to know that the treatment was longer than expected.

I tested the following :
- Run task "C:\myprog.exe" with wait option "Don't wait"
- Pause 1 sec
- Wait for Process Finish "C:\myprog.exe", with a timeout, and "Assign Exit Code of Process to variable" :
"RETURN_CODE"

But in "RETURN_CODE" I have :
- 0 if "C:\myprog.exe" is finished before timeout => It is not the return code of "myprog.exe"
- "" (empty string) if it was longer

Any idea ?
Last edited by Vara04 on Sun Jul 22, 2012 7:11 pm, edited 1 time in total.
Post Reply