Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to wait n seconds for Runtime.getRuntime.exec() to execute

Status
Not open for further replies.

russland

Programmer
Jan 9, 2003
315
0
0
CH
Hi,

Some system commands would halt the execution if one has not enough privileges to do so. How, can I allow my runtime to try for - let's say - 10 seconds. But if nothing is return and the command is blocked, then continue.

What's a solid approach to this?

Thanks for any hints.
 
You can use Thread.sleep to wait, but I guess you will have to check the command output, depending on what you're executing.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top