Example #1
0
 public static int Command(string command, string arguments)
 {
     ConsoleProcess proc = new ConsoleProcess();
     proc.Arguments = arguments;
     proc.AppFileName = command;
     proc.Start();
     proc.Wait();
     return proc.ExitCode;
 }
Example #2
0
        public static int Command(string command, string arguments)
        {
            ConsoleProcess proc = new ConsoleProcess();

            proc.Arguments   = arguments;
            proc.AppFileName = command;
            proc.Start();
            proc.Wait();
            return(proc.ExitCode);
        }
Example #3
0
 public static int Command(string command, string arguments, IList<string> stdoutAndErr)
 {
     ConsoleProcess proc = new ConsoleProcess();
     proc.Arguments = arguments;
     proc.AppFileName = command;
     proc.StderrLineRead += l => { lock (stdoutAndErr) stdoutAndErr.Add(l); };
     proc.StdoutLineRead += l => { lock (stdoutAndErr) stdoutAndErr.Add(l); };
     proc.Start();
     proc.Wait();
     return proc.ExitCode;
 }
Example #4
0
        public static int Command(string command, string arguments, IList <string> stdoutAndErr)
        {
            ConsoleProcess proc = new ConsoleProcess();

            proc.Arguments       = arguments;
            proc.AppFileName     = command;
            proc.StderrLineRead += l => { lock (stdoutAndErr) stdoutAndErr.Add(l); };
            proc.StdoutLineRead += l => { lock (stdoutAndErr) stdoutAndErr.Add(l); };
            proc.Start();
            proc.Wait();
            return(proc.ExitCode);
        }