/// <summary>
 /// Launches a process.
 /// </summary>
 /// <remarks>
 /// The output and error streams are not redirected making them not available for read
 /// </remarks>
 public static SystemProcess Launch(String command, SystemProcessArguments commandParams, bool hidden, ProcessPriorityClass priority)
 {
     // LEGACY STUFF: Outputs are not redirected because the code that uses this method does not read them
     // Setting it to true may cause the system process to hang waiting for the outputs to be read
     // which causes the launcher process to hang waiting for the system process to end
     return(Launch(command: command, commandParams: commandParams, path: null, redirectOutputs: false, hidden: hidden, priority: priority, username: null, domain: null, password: null));
 }
        private static SystemProcess Launch(string command, SystemProcessArguments commandParams, string path, bool redirectOutputs, bool?hidden, ProcessPriorityClass priority, string username, string domain, string password)
        {
            var process = new SystemProcess(command);

            process.arguments       = commandParams;
            process.path            = path;
            process.redirectOutputs = redirectOutputs;
            process.hidden          = hidden;
            process.priority        = priority;
            process.username        = username;
            process.domain          = domain;
            process.password        = password;
            process.Execute();
            return(process);
        }
        /// <summary>
        /// Launches a process.
        /// </summary>
        /// <remarks>
        /// The output and error streams are redirected.
        /// It is advised to read its contents to prevent the process from hanging by writing to a full buffer.
        /// </remarks>

        public static SystemProcess Launch(String command, SystemProcessArguments commandParams, String path, ProcessPriorityClass priority, Action <string> outHandle = null, Action <string> errHandle = null)
        {
            return(Launch(command, commandParams, path, true, null, priority, null, null, null, outHandle, errHandle));
        }
 private static SystemProcess Launch(string command, SystemProcessArguments commandParams, string path, bool redirectOutputs, bool?hidden, ProcessPriorityClass priority, string username, string domain, string password, Action <string> outHandle = null, Action <string> errHandle = null)
 {
     return(Launch(command, commandParams.ToString(), path, redirectOutputs, hidden, priority, username, domain, password, outHandle, errHandle));
 }
 /// <summary>
 /// Launches a process.
 /// </summary>
 /// <remarks>
 /// The output and error streams are redirected.
 /// It is advised to read its contents to prevent the process from hanging by writing to a full buffer.
 /// </remarks>
 public static SystemProcess Launch(String command, SystemProcessArguments commandParams, String path, ProcessPriorityClass priority)
 {
     return(Launch(command, commandParams, path, true, null, priority, null, null, null));
 }