16,554
社区成员
发帖
与我相关
我的任务
分享
Dim myProcess As System.Diagnostics.Process = New System.Diagnostics.Process
Dim bOk As Boolean
myProcess.StartInfo.FileName = "a.exe" ' exe文件路径
myProcess.StartInfo.Arguments = "b.dat" ' dat文件路径
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.StartInfo.RedirectStandardError = True
myProcess.StartInfo.CreateNoWindow = True
bOk = myProcess.Start()
sReturn = ""
If bOk Then
sReturn = myProcess.StandardError.ReadToEnd()
Else
sReturn = "执行失败"
End If
myProcess.WaitForExit()
myProcess.Close()
myProcess.Dispose()
MsgBox(sReturn)
Public Sub frun(ByVal fname As String)
If fname = "" Then Return
Dim wShell, ReturnCode
wShell = CreateObject("wscript.shell")
ReturnCode = wShell.Run(fname, 8, False)
End Sub
frun("E:\form6i\BIN\ifrun60.EXE main.fmx window_state=maximize")