Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding command window in vb.net when running processes

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!

like image 480
Envin Avatar asked Aug 02 '12 16:08

Envin


1 Answers

You can do it by setting CreateNoWindow to true, This may help MSDN

Proc.StartInfo.CreateNoWindow = true
like image 131
Adil Avatar answered Nov 15 '22 09:11

Adil