CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2000
    Location
    The Netherlands
    Posts
    26

    wait for program

    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.


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: wait for program

    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
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured