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

前端 未结 7 868

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条回答
  •  攒了一身酷
    2020-11-29 10:05

    I've found a better & simpler solution:

    Dim processID = Shell("C:/path/to/process.exe " + args
    Dim p As Process = Process.GetProcessById(processID)
    p.WaitForExit()
    

    and then you just continue with your code. Hope it helps ;-)

提交回复
热议问题