title: Writing Run (on startup) registry key
body: <p>My goal is to have my application run on startup.</p>
  
  <p>My problem is my application is not writing to 'Run' in regedit.</p>
  
  <p>I have this code</p>
  
  <pre><code>RegistryKey rWrite = Registry.CurrentUser.OpenSubKey(@"HKey_Current_User\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
  </code></pre>
  
  <p>and I believe what this is suppose to do is write my application to </p>
  
  <pre><code>HKey_Current_User\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\run
  </code></pre>
  
  <p>However, this is not writing anything to regedit. </p>
  
  <p>Things to note:</p>
  
  <p>My application forces the user to run in administrator. It essentially checks if they have ran in administrator and if they haven't it displays a messagebox then closes the program with</p>
  
  <pre><code>Environment.Exit(0);
  </code></pre>