title: Catching a vbscript error from c# (the vbscriot executed from c#)
body: <p>i'm trying to execute vbscript from c#, the vbscript runs always succesfully despite of the fact that i don't have permissions to run this script.</p>
  
  <p>the code:</p>
  
  <pre><code>        //nswp is the User's password
          foreach (char c in uspw)
          {
              password.AppendChar(c);
          }
          Process scriptProc = new Process();
          scriptProc.StartInfo.RedirectStandardOutput = true;
          scriptProc.StartInfo.RedirectStandardError = true;
          scriptProc.StartInfo.Domain = "moia.gov.il";
          scriptProc.StartInfo.ErrorDialog = true;
          scriptProc.StartInfo.UserName = Globals.CURRENT_USER.user_name;
          scriptProc.StartInfo.Password = password;
          scriptProc.StartInfo.UseShellExecute = false;
          scriptProc.StartInfo.FileName = @"cscript";
          scriptProc.StartInfo.Arguments = "//B //Nologo " + pathSave;
          scriptProc.Start();
          scriptProc.WaitForExit();
          scriptProc.Close();
  </code></pre>
  
  <p>When i'm executing this vbscript manually (by double click on the file icon) i get a permissions error, as i should.</p>
  
  <p>How can i catch this error in c# and throw exception respectively.</p>