The (Default) value is special. To retrieve it, specify either an empty string ("") or null:
string path = (string)acroPath.GetValue(null);
That should solve the problem you've asked about.
A few other tips:
1) You don't need to open each individual subkey in turn - you can specify the complete path, or any part thereof in this case, thus with one call you can do this:
RegistryKey acroRead = Registry.LocalMachine.OpenSubKey(@"Software\Adobe\Acrobat Reader");
2) The above might help you to avoid some errors - for example you are checking that "adobe" is not null, when you should be testing against acroRead:
if (acroRead != null)
{
acroReadVersions = acroRead.GetSubKeyNames();
3) RegistryKey is disposable, so ideally you should wrap the use of it in a "using" block. Opening fewer keys will mean you need to do this less often (and presently, doing OpenSubKey().OpenSubKey() you can't specify a using statement for each one!)
4) Not sure what your extra assignments are for at the end (path = path; etc. These don't do anything).
5) In testing I noted that I have version 11.0 of Adobe Reader, so you might want to add that in.
6) I assume Adobe's installation removes earlier version registry keys? If that cannot be assumed you may want to check for the highest value rather than the first one encountered.
Taking the liberty of re-working your code slightly then, apart from item 6 -
and allowing for this to work on 32-bit windows (targeting x86 or AnyCPU) or 64-bit windows (targeting x86, x64 or AnyCPU):
RegistryKey acroRead = Registry.LocalMachine.OpenSubKey(@"Software\Adobe\Acrobat Reader");
if (null == acroRead)
{
acroRead = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\Adobe\Acrobat Reader");
}
if (acroRead != null)
{
using (acroRead)
{
string vnumber = "";
string[] acroReadVersions = acroRead.GetSubKeyNames();
foreach (string versionNumber in acroReadVersions)
{
switch (versionNumber)
{
case "9.0":
vnumber = versionNumber;
break;
case "10.0":
vnumber = versionNumber;
break;
case "11.0":
vnumber = versionNumber;
break;
default:
break;
}
}
if (!string.IsNullOrEmpty(vnumber))
{
using (RegistryKey acroVersion = acroRead.OpenSubKey(vnumber))
{
using (RegistryKey acroPath = acroVersion.OpenSubKey("InstallPath"))
{
string path = (string)acroPath.GetValue(null);
}
}
}
else
{
}
}
}
else
{
}
Regards,
Ian.