可能重复:
How to wait for a shell process to finish before executing further code in VB6
我想编写将生成文本文件的程序,用另一个程序处理它然后加载结果。
正在进行实验时,代码略有不同:
Main.Command2.Enabled = False
Shell "foobar.exe =bar.txt +" & "foo.txt", vbMinimizedNoFocus
Main.Command2.Enabled = True
Kill "bar.txt"
并且bar.txt
文件仍保留在目录中,foobar
的测试例程不会抛出bar.txt
存在的错误。
如何强制我的程序等到foobar.exe
完成?
已在How to wait for a shell process to finish before executing further code in vb6
解决