Click to See Complete Forum and Search --> : wait for program


vampyre
June 27th, 2001, 02:19 PM
I'm writing an installer program that will automate a series of commands, like running a program or copying files. I would like to know how you can execute a program (i.e. with Shell), and then make your program wait for that process to complete. I know it's possible, but I never figured it out myself.
Also, is there a way to 'reroute' all output from an executed BAT file to your app, like encoder UI's do (they show the output from the actual encoder program in a text box). TIA, Vampyre.

Iouri
June 27th, 2001, 02:30 PM
Function MyFunc()
Dim myObject As Object
Dim RetVal As Variant

Set myObject = CreateObject("WScript.Shell")
RetVal = myObject.Run("c:\windows\notepad.exe", 1, True)
MsgBox "Notepad is closed"

End Function


'TRue - wait until proc is over
'False don't wait

Iouri Boutchkine
iouri@hotsheet.com