Muhnamana
Muhnamana

Reputation: 1044

Hide Command Prompt When Executing An EXE

Alright, so here's command I'm currently running. Upon executing, a command prompt apprears until the command is finished.

Is there any way to hide the command prompt?

Process.Start(
    "\\path_to_exe\Testing.exe ",
    Arg2 + Arg3 + Arg4 + Arg5 + Arg6 + Arg7 + Arg8 + Arg9 + Arg10 + Arg11)

Upvotes: 3

Views: 16355

Answers (3)

Matthew
Matthew

Reputation: 1

Shell("cmd.exe", AppWinStyle.Hide)

Upvotes: 0

juergen d
juergen d

Reputation: 204784

Dim p as New ProcessStartInfo(@"command", args)
p.WindowStyle = ProcessWindowStyle.Hidden
p.CreateNoWindow = true
Process.Start(p)

Upvotes: 9

Muhnamana
Muhnamana

Reputation: 1044

I'm not a 100% sure why I was getting syntax errors based on @juergen d's answer but I found this and it seems to work just as well.

Dim psInfo As New System.Diagnostics.ProcessStartInfo("path_to_exe", Arg2 + Arg3 + Arg4 + Arg5 + Arg6 + Arg7 + Arg8 + Arg9 + Arg10 + Arg11)
    psInfo.WindowStyle = ProcessWindowStyle.Hidden
    System.Diagnostics.Process.Start(psInfo)

Upvotes: 0

Related Questions