【发布时间】:2017-12-26 21:08:08
【问题描述】:
这是运行 openfiles.exe 并从中返回输出 如果我在命令行运行 openfiles.exe 它会按预期工作 当我在这里运行它时没有错误,但我在消息框中什么也没有
Dim NewProcess As New Process()
With NewProcess.StartInfo
.FileName = "openfiles.exe"
.Arguments = "/query /s FakeServer/fo csv /V /U FakeDomain\Fakeuser/P pword"
.RedirectStandardOutput = True
.RedirectStandardError = True
.RedirectStandardInput = True
.UseShellExecute = False
.WindowStyle = ProcessWindowStyle.Normal
.CreateNoWindow = False
End With
NewProcess.Start()
System.Threading.Thread.Sleep(5000)
MsgBox(NewProcess.StandardOutput.ReadToEnd)
【问题讨论】:
-
一些应用程序(例如 FFmpeg)写入错误流而不是输出流。你也试过
MsgBox(NewProcess.StandardError.ReadToEnd())吗?