正在运行的进程,当在vb.net隐藏命令窗口(Hiding command window in vb

2019-09-20 16:27发布

如果我有这样的代码

    ' 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()

我能做些什么使命令窗口未出现此执行时? 谢谢!

Answer 1:

您可以通过CreateNoWindow设置为true做到这一点,这可能有助于MSDN

Proc.StartInfo.CreateNoWindow = true


文章来源: Hiding command window in vb.net when running processes