title: search an uninstall from registry key C#
body: <p>I want to uninstall some app programmatically. I'm searching in this path in win registry:</p>
  <pre><code>\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
  </code></pre>
  <p>the code for searching and uninstalling is the following:</p>
  <pre><code>public string UninstallCMD;
  
      public bool SearchApp(string p_name)
              {
                  string displayName;
                  RegistryKey key;
      
      key = Registry.LocalMachine.OpenSubKey(@&quot;SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall&quot;);
                  foreach (String keyName in key.GetSubKeyNames())
                  { 
                      RegistryKey subkey = key.OpenSubKey(keyName);
                      displayName = subkey.GetValue(&quot;DisplayName&quot;) as string;
                  
                      if (p_name.Equals(displayName, StringComparison.OrdinalIgnoreCase) == true)
                      {
                          UninstallCMD = subkey.GetValue(&quot;UninstallString&quot;) as string;
                          return true;
                      }
                  }
      }
  </code></pre>
  <p>My problem is that not all the key were read. The key that I want to be read is <strong>{56DDDFB8-7F79-4480-89D5-25E1F52AB28F}</strong> but is ignored like the other in <strong>{ }</strong> (in this <a href="https://i.stack.imgur.com/CUlb7.png" rel="nofollow noreferrer">image</a> you can see the key ignored)</p>
  <p>The key without <strong>{ }</strong> were read normally (i.e. 7-zip, VLC media player, ...)</p>