如果我有这段代码
' Send file to Unix server via pscp
Dim Proc As New System.Diagnostics.Process
Proc.StartInfo = New ProcessStartInfo("C:\Windows\System32\cmd.exe")
Proc.StartInfo.Arguments = "/C C:\pscp.exe -pw " & PASSWORD & " " & physicalFolder & "\" & UNIXSCRIPTNAME & " " & unixLogin
Proc.StartInfo.RedirectStandardInput = True
Proc.StartInfo.RedirectStandardOutput = False
Proc.StartInfo.UseShellExecute = False
Proc.Start()
' Allows script to execute sequentially instead of simultaneously
Proc.WaitForExit()
执行此操作时,如何才能显示命令窗口? 谢谢!
答案 0 :(得分:4)
你可以通过将CreateNoWindow设置为true来实现,这可能会有所帮助MSDN
Proc.StartInfo.CreateNoWindow = true
答案 1 :(得分:1)
CreateNoWindow = True
对我不起作用,以下工作完美:
Proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden