Changing registry settings through .Net app
-
Hi Friends, I want to do some registry settings changes through my .net app. Registry settings change will happen only in the "Settings" part of the app like "Starts at Windows" i.e. put an entry in the "Run" key. But to do this things in Win7 or Vista I am experiencing problems like Unauthorized access due to UAC. I am not being able to change the settings. I don't want to run the app in admin mode each time it runs, I just only want to elevate the permission at the time of changing the registry settings. Can anyone please help me out in this situation on how to accomplish this task like by modifying manifest file or putting permission attribute, anything at all. Thanks in advance.
Anindya Chatterjee -------------------------------------------------------- 1. Don't Visit ..[^] 2. But Watch ..
-
Hi Friends, I want to do some registry settings changes through my .net app. Registry settings change will happen only in the "Settings" part of the app like "Starts at Windows" i.e. put an entry in the "Run" key. But to do this things in Win7 or Vista I am experiencing problems like Unauthorized access due to UAC. I am not being able to change the settings. I don't want to run the app in admin mode each time it runs, I just only want to elevate the permission at the time of changing the registry settings. Can anyone please help me out in this situation on how to accomplish this task like by modifying manifest file or putting permission attribute, anything at all. Thanks in advance.
Anindya Chatterjee -------------------------------------------------------- 1. Don't Visit ..[^] 2. But Watch ..
Are you writing to HKLM? Try writing to HKCU and you will not have security issues.
Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion
-
Are you writing to HKLM? Try writing to HKCU and you will not have security issues.
Giorgi Dalakishvili #region signature My Articles Asynchronous Registry Notification Using Strongly-typed WMI Classes in .NET [^] My blog #endregion
I tried with
RegistryKey runKey = Registry.CurrentUser.OpenSubKey(@"\Software\Microsoft\Windows\CurrentVersion\Run", true);
but runKey is getting always null in Win7 and XP also. What to do? Please help me out.Anindya Chatterjee -------------------------------------------------------- 1. Don't Visit ..[^] 2. But Watch ..