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);
        }
Ejemplo n.º 2
0
        private static SystemProcess Launch(string command, string commandParams, string path, bool redirectOutputs, bool?hidden, ProcessPriorityClass priority, string username, string domain, string password, Action <string> outHandle = null, Action <string> errHandle = null)
        {
            var process = new SystemProcess(command);

            process.inlineArguments = commandParams;
            process.path            = path;
            process.redirectOutputs = redirectOutputs;
            if (redirectOutputs && errHandle != null && outHandle != null)
            {
                process.errHandle = errHandle;
                process.outHandle = outHandle;
            }
            process.hidden   = hidden;
            process.priority = priority;
            process.username = username;
            process.domain   = domain;
            process.password = password;
            process.Execute();
            return(process);
        }