Executes a Windows Command Line using Shell Execute as a single command line with parameters. This method handles parsing out the executable from the parameters.
public static void ExecuteCommandLine(string fullCommandLine, string workingFolder, int waitForExitMs, string verb, ProcessWindowStyle windowStyle, bool useShellExecute)
Parameters
fullCommandLine
Full command line - Executable plus arguments.
If the executable contains paths with spaces make sure to add quotes around the executable otherwise the executable may not be found.
workingFolder
Optional - the folder the executable runs in. If not specified uses current folder.
waitForExitMs
Optional - Number of milliseconds to wait for completion. 0 don't wait.
verb
Optional - Shell verb to apply. Defaults to "Open"
windowStyle
Optional - Windows style for the launched application. Default style is normal
useShellExecute
Remarks
If the executable or parameters contain or may contain spaces make sure you use quotes (") or (') around the exec or parameters.
throws if the process fails to start or doesn't complete in time (if timeout is specified).
See also:
Class ShellUtils© West Wind Technologies, 1996-2024 • Updated: 06/29/24
Comment or report problem with topic