为什么我打开cmd后这里什么东西都没有?往里面也写不了内容啊?
有没大神救一下啊~!
附上我的代码:
Public Function ExeCommand(ByVal commandText As String) As Boolean
Dim p As New Process
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardInput = True
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.RedirectStandardError = True
'p.StartInfo.CreateNoWindow = True
Try
p.Start()
p.StandardInput.AutoFlush = True
p.StandardInput.WriteLine("command:" & commandText)
p.StandardInput.WriteLine("exit")
p.WaitForExit()
p.Close()
Catch ex As Exception
Return False
End Try
Return True