Giving Application Rights to Change Registry in Windows XP
<p>I don't have XP on any of my machines.  My efforts to get a small application to run as Administrator in Vista and Windows 7 work.  However one of my testers is reporting that on Windows XP he is getting the following exception:</p>

<pre><code>System.UnauthorizedAccessException: Access to the registry key 'HKEY_CLASSES_ROOT\.ad2' is denied.
   at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
</code></pre>

<p>The code I am using to run the application that tries to write to the registry is:</p>

<pre><code>var proc = new ProcessStartInfo {
                UseShellExecute = true,
                WorkingDirectory = Environment.CurrentDirectory,
                FileName = Path.Combine(Application.StartupPath, "ADEFileAssociator.exe"),
                Verb = "runas"
            };

            try {
                Process.Start(proc);
            }
            catch {
                MessageBox.Show("Failed to start File Associator", "Process Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
</code></pre>

<p>This works fine for Vista and Win7 opening the UAC dialog.  If the user accepts to run then the registry is updated on these versions.  I assumed that the same would work for XP.  Clearly I was wrong.  So my question is 'what else do I need to do to get my app to write to the registry in XP?</p>
