让他关掉吧!
你主要是在运行时把它的输出流读出来就行了!
还有就是不要把 Console 程序总是说成 C 程序!
C可以写 Console程序 也能写 Windows 程序!
使用 WScript.Shell 对象运行你所说的C程序之后,就可以用 StdOut 在读取他的输出流内容,StdIn 输入流, StdErr 错误流!
下面是个例子
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("test.bat")
input = ""
Do While True
If Not oExec.StdOut.AtEndOfStream Then
input = input & oExec.StdOut.Read(1)
If InStr(input, "Press any key") <> 0 Then Exit Do
End If
WScript.Sleep 100
Loop
oExec.StdIn.Write VbCrLf
Do While oExec.Status <> 1
WScript.Sleep 100
Loop