How to wait for a shell process to finish before executing further code in VB6

前端 未结 7 865

I have a small VB6 app in which I use the Shell command to execute a program. I am storing the output of the program in a file. I am then reading this file and

7条回答
  •  -上瘾入骨i
    2020-11-29 09:55

    I know it's an old thread, but...

    How about using the Windows Script Host's Run method? It has a bWaitOnReturn parameter.

    object.Run (strCommand, [intWindowStyle], [bWaitOnReturn])

    Set oShell = CreateObject("WSCript.shell")
    oShell.run "cmd /C " & App.Path & sCommand, 0, True
    

    intWindowStyle = 0, so cmd will be hidden

提交回复
热议问题