WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

ShellExecute With Wait

 Keywords: ShellExecute Wait Finish Done AppExist Retries 

Question:

Is there a way to have ShellExecute wait until the command it's running finishes?

Answer:

Yes. Add an AppExist loop immediately after the ShellExecute. For Example:
programname = 'notepad.exe'
ShellExecute( programname, '', '', @NORMAL, '' )
While AppExist(programname, 0 , 0  )
    TimeDelay( 0.25 )
EndWhile
Pause( 'ShellExecute with wait', 'Complete' )
Exit

Article ID:   W17899
Filename:   ShellExecute With Wait.txt
File Created: 2014:04:03:07:30:18
Last Updated: 2014:04:03:07:30:18