That works, but if I turn off the setting how can I delete such a key in the
registry? The command:
Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run").DeleteValue("myKey");
throws an exception about permissions.
> You could use the Run registry key :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/setup/
run_and_runonce_registry_keys.asp
[quoted text clipped - 6 lines]
>> when the preference is set (rather than just rely on the user adding it
>> to his Startup program group).
Claes Bergefall - 24 Mar 2006 15:58 GMT
You need to open it as writeable:
Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run",
true).DeleteValue("myKey");
/claes
> That works, but if I turn off the setting how can I delete such a key in
> the registry? The command:
[quoted text clipped - 13 lines]
>>> when the preference is set (rather than just rely on the user adding it
>>> to his Startup program group).
JezB - 27 Mar 2006 00:23 GMT
Doh! Now I feel silly.
Cheers mate.
> You need to open it as writeable:
> Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run",
[quoted text clipped - 19 lines]
>>>> when the preference is set (rather than just rely on the user adding it
>>>> to his Startup program group).