Guest User

Untitled

a guest
Apr 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. info.WorkingDirectory = @"C:r_installsR-3.3.2binx64";
  2. info.FileName = @"C:r_installsR-3.3.2binx64R.exe";
  3.  
  4. info.Arguments = $"--vanilla";
  5. info.RedirectStandardInput = true;
  6. info.RedirectStandardOutput = true;
  7. info.RedirectStandardError = true;
  8. info.UseShellExecute = false;
  9. info.CreateNoWindow = true;
  10. info.ErrorDialog = true;
  11.  
  12. info.Domain = _Cred.Domain;
  13. info.UserName = _Cred.UserName;
  14. info.Password = _Cred.PwdSecure;
  15.  
  16. var proc = new Process();
  17. proc.OutputDataReceived += new DataReceivedEventHandler(ReadAsyncOutput);
  18. proc.ErrorDataReceived += new DataReceivedEventHandler(ReadAsyncOutput);
  19.  
  20. proc.StartInfo = info;
  21. proc.Start();
  22. proc.WaitForExit();
  23.  
  24. proc.BeginOutputReadLine();
  25. proc.BeginErrorReadLine();
Add Comment
Please, Sign In to add comment