title: Error when running vbs via C# application
body: <p>I want my C# application to run an external vbscript. This Vbs is performing some actions, and needs to retrieve a data from the registry.</p>
  
  <p>The vbscript is launched, but I've got an error : Unable to open registry value for reading.</p>
  
  <p>I don't really understand why.</p>
  
  <p>That's how I run the vbscript :</p>
  
  <pre><code>            Process scriptProc = new Process();
              scriptProc.StartInfo.FileName = @"c:\windows\system32\wscript";
              scriptProc.StartInfo.WorkingDirectory = repository + p + "\\"; &lt;-- location of my script : C:\temp\soft\
              scriptProc.StartInfo.Arguments = "MyScript.vbs";
              scriptProc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
              scriptProc.StartInfo.Verb = "runas";
              scriptProc.Start();
              scriptProc.WaitForExit();
              scriptProc.Close();
  </code></pre>
  
  <p>And in my VBS, I read the value like that : </p>
  
  <pre><code>strValue = objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\MyKey\MySubKey\MyReg_Sz_Entry")
  </code></pre>
  
  <p>Where "MyReg_Sz_Entry" contains a string value. This value is correctly returned when i run the vbs normally, but not with my C# code.</p>
  
  <p>My account has administrative privilege.</p>
  
  <p>I need some help :).</p>
  
  <p>Thank's</p>