问题
If I have this code
' 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()
What can I do to make the command window NOT appear when this is executed? Thanks!
回答1:
You can do it by setting CreateNoWindow to true, This may help MSDN
Proc.StartInfo.CreateNoWindow = true
来源:https://stackoverflow.com/questions/11781600/hiding-command-window-in-vb-net-when-running-processes