Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Changing registry settings through .Net app

Changing registry settings through .Net app

Scheduled Pinned Locked Moved C#
csharpcomwindows-adminhelptutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anindya Chatterjee
    wrote on last edited by
    #1

    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 ..

    G 1 Reply Last reply
    0
    • A Anindya Chatterjee

      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 ..

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      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

      A 1 Reply Last reply
      0
      • G Giorgi Dalakishvili

        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

        A Offline
        A Offline
        Anindya Chatterjee
        wrote on last edited by
        #3

        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 ..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups