@@ -585,7 +585,7 @@ public long StopwatchLogInfo(string className, string message, Action action, [C
585585 public Task < long > StopwatchLogInfoAsync ( string className , string message , Func < Task > action , [ CallerMemberName ] string methodName = "" ) =>
586586 Stopwatch . InfoAsync ( className , message , action , methodName ) ;
587587
588- public bool StartProcess ( string fileName , string workingDirectory = "" , string arguments = "" , bool useShellExecute = false , string verb = "" )
588+ public bool StartProcess ( string fileName , string workingDirectory = "" , string arguments = "" , bool useShellExecute = false , string verb = "" , bool createNoWindow = false )
589589 {
590590 try
591591 {
@@ -597,7 +597,13 @@ public bool StartProcess(string fileName, string workingDirectory = "", string a
597597 var result = Win32Helper . RunAsDesktopUser (
598598 Constant . CommandExecutablePath ,
599599 Environment . CurrentDirectory ,
600- $ "-StartProcess -FileName { AddDoubleQuotes ( fileName ) } -WorkingDirectory { AddDoubleQuotes ( workingDirectory ) } -Arguments { AddDoubleQuotes ( arguments ) } -UseShellExecute { useShellExecute } -Verb { AddDoubleQuotes ( verb ) } ",
600+ $ "-StartProcess " +
601+ $ "-FileName { AddDoubleQuotes ( fileName ) } " +
602+ $ "-WorkingDirectory { AddDoubleQuotes ( workingDirectory ) } " +
603+ $ "-Arguments { AddDoubleQuotes ( arguments ) } " +
604+ $ "-UseShellExecute { useShellExecute } " +
605+ $ "-Verb { AddDoubleQuotes ( verb ) } " +
606+ $ "-CreateNoWindow { createNoWindow } ",
601607 false ,
602608 true , // Do not show the command window
603609 out var errorInfo ) ;
@@ -616,6 +622,7 @@ public bool StartProcess(string fileName, string workingDirectory = "", string a
616622 Arguments = arguments ,
617623 UseShellExecute = useShellExecute ,
618624 Verb = verb ,
625+ CreateNoWindow = createNoWindow
619626 } ;
620627 Process . Start ( info ) ? . Dispose ( ) ;
621628 return true ;
@@ -627,8 +634,8 @@ public bool StartProcess(string fileName, string workingDirectory = "", string a
627634 }
628635 }
629636
630- public bool StartProcess ( string fileName , string workingDirectory = "" , Collection < string > argumentList = null , bool useShellExecute = false , string verb = "" ) =>
631- StartProcess ( fileName , workingDirectory , JoinArgumentList ( argumentList ) , useShellExecute , verb ) ;
637+ public bool StartProcess ( string fileName , string workingDirectory = "" , Collection < string > argumentList = null , bool useShellExecute = false , string verb = "" , bool createNoWindow = false ) =>
638+ StartProcess ( fileName , workingDirectory , JoinArgumentList ( argumentList ) , useShellExecute , verb , createNoWindow ) ;
632639
633640 private static string AddDoubleQuotes ( string arg )
634641 {
0 commit comments