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 / C++ / MFC
  4. How to export registry settings safely under Windows 7?

How to export registry settings safely under Windows 7?

Scheduled Pinned Locked Moved C / C++ / MFC
windows-admintutorialquestion
3 Posts 3 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.
  • E Offline
    E Offline
    Erik
    wrote on last edited by
    #1

    Hi, I need to export some Registry Keys in HKCU in my application, so I simply make a call to regedit and user commandlineparameters /s /e to export these keys to a file. This used to work fine, but under Windows 7, everytime I call regedit I get an annoying message from UAC asking the user to allow this (in my eyes really uncritical) action. Do you have any suggestion how I can easily export a whole registry key to a reg-file, without getting a UAC warning?

    _ D 2 Replies Last reply
    0
    • E Erik

      Hi, I need to export some Registry Keys in HKCU in my application, so I simply make a call to regedit and user commandlineparameters /s /e to export these keys to a file. This used to work fine, but under Windows 7, everytime I call regedit I get an annoying message from UAC asking the user to allow this (in my eyes really uncritical) action. Do you have any suggestion how I can easily export a whole registry key to a reg-file, without getting a UAC warning?

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You need to elevated privileges to run <code>regedit.exe</code>. So you either select allow from the UAC prompt or run <code>regedit.exe</code> from an elevated process. For example, if you run <code>cmd.exe</code> in elevated mode and then run <code>regedit.exe</code> from this command prompt you will not be asked whether to allow or deny.

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      1 Reply Last reply
      0
      • E Erik

        Hi, I need to export some Registry Keys in HKCU in my application, so I simply make a call to regedit and user commandlineparameters /s /e to export these keys to a file. This used to work fine, but under Windows 7, everytime I call regedit I get an annoying message from UAC asking the user to allow this (in my eyes really uncritical) action. Do you have any suggestion how I can easily export a whole registry key to a reg-file, without getting a UAC warning?

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Will RegSaveKeyEx() work for you?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Man who follows car will be exhausted." - Confucius

        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