title: Register dll on Windows 7 in C#
body: <p>How can I register my written dll's on Windows 7?</p>
  
  <p>I found this code fragment but it seems to not work in Windows 7:</p>
  
  <pre><code>public static void registerDLL(string dllPath) 
  {
    try {
      //'/s' : indicates regsvr32.exe to run silently.
      string fileinfo = "/s" + " " + "\"" + dllPath + "\"";
  
      Process reg = new Process();
      reg.StartInfo.FileName = "regsvr32.exe";
      reg.StartInfo.Arguments = fileinfo;
      reg.StartInfo.UseShellExecute = false;
      reg.StartInfo.CreateNoWindow = true;
      reg.StartInfo.RedirectStandardOutput = true;
      reg.Start();
      reg.WaitForExit();
      reg.Close();
      }
  catch(Exception ex) {
      MessageBox.Show(ex.Message);
      }
  }
  </code></pre>