title: Getting Windows serial number (was: Getting MachineGuid from Registry)
body: <p>I am trying to fetch <code>MachineGuid</code> from the registry, to create some level of binding with the OS for my license system. From the documentation I can use</p>
  
  <pre><code>string key = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography";
  string r = (string)Registry.GetValue(key, "MachineGuid", (object)"default");
  </code></pre>
  
  <p>to get it. Also, the docs tell me that I get <code>"default"</code> when the name is not found, or <code>null</code> if the key doesn't exist. I should get a security exception if I have no access.</p>
  
  <p>The above code gives me <code>"default"</code>, which means the name isn't found. However, if I look in the registry with RegEdit, it's there. How do I get the <code>MachineGuid</code> value from an application without administrator privileges?</p>
  
  <p><strong>Update</strong>: when using <code>reg.exe</code> I have no problems getting the value.</p>
  
  <p><strong>Update</strong>: I updated the title, so people looking for a unique way of determining the Windows install get here as well.</p>