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. Save multiple registry keys

Save multiple registry keys

Scheduled Pinned Locked Moved C / C++ / MFC
questionwindows-admin
12 Posts 5 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
    Ajay L D
    wrote on last edited by
    #1

    Hi All, How can I save multiple registry keys into a single file? The RegSaveKeyEx() fails if a file already exists. Thank you, AJ

    R D H 3 Replies Last reply
    0
    • A Ajay L D

      Hi All, How can I save multiple registry keys into a single file? The RegSaveKeyEx() fails if a file already exists. Thank you, AJ

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      Ajay L D wrote:

      The RegSaveKeyEx() fails if a file already exists.

      Can't you rename the existing file and delete it later if RegSaveKeyEx() succeeds?

      Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

      A C 2 Replies Last reply
      0
      • R Rajesh R Subramanian

        Ajay L D wrote:

        The RegSaveKeyEx() fails if a file already exists.

        Can't you rename the existing file and delete it later if RegSaveKeyEx() succeeds?

        Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

        A Offline
        A Offline
        Ajay L D
        wrote on last edited by
        #3

        Thanks! I could do it, but I need to store all the values into a single file, by appending the values. I would have multiple calls to RegSaveKeyEx() but the file name needs to be the same. Thank you, AJ

        1 Reply Last reply
        0
        • R Rajesh R Subramanian

          Ajay L D wrote:

          The RegSaveKeyEx() fails if a file already exists.

          Can't you rename the existing file and delete it later if RegSaveKeyEx() succeeds?

          Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

          C Offline
          C Offline
          CPallini
          wrote on last edited by
          #4

          I think the OP wasn't asking about that (my CPMRU battery pack is fully charged): maybe he was asking how to write multiple keys (possibly unrelated) in the same file. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

          A 1 Reply Last reply
          0
          • C CPallini

            I think the OP wasn't asking about that (my CPMRU battery pack is fully charged): maybe he was asking how to write multiple keys (possibly unrelated) in the same file. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

            A Offline
            A Offline
            Ajay L D
            wrote on last edited by
            #5

            You hit the bull's eye!! :-) Any answers? Thank you, AJ

            C 1 Reply Last reply
            0
            • A Ajay L D

              You hit the bull's eye!! :-) Any answers? Thank you, AJ

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              Nope, unfortunately. :(( :)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

              R 1 Reply Last reply
              0
              • C CPallini

                Nope, unfortunately. :(( :)

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                R Offline
                R Offline
                Rajesh R Subramanian
                wrote on last edited by
                #7

                CPallini wrote:

                Nope, unfortunately. [Cry]

                Running low on drugs? :suss:

                Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                C 1 Reply Last reply
                0
                • R Rajesh R Subramanian

                  CPallini wrote:

                  Nope, unfortunately. [Cry]

                  Running low on drugs? :suss:

                  Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                  C Offline
                  C Offline
                  CPallini
                  wrote on last edited by
                  #8

                  Yes. :-D

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

                  1 Reply Last reply
                  0
                  • A Ajay L D

                    Hi All, How can I save multiple registry keys into a single file? The RegSaveKeyEx() fails if a file already exists. Thank you, AJ

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

                    Call RegSaveKeyEx() as many times as necessary, then merge all of the files into one.

                    "Love people and use things, not love things and use people." - Unknown

                    "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                    1 Reply Last reply
                    0
                    • A Ajay L D

                      Hi All, How can I save multiple registry keys into a single file? The RegSaveKeyEx() fails if a file already exists. Thank you, AJ

                      H Offline
                      H Offline
                      Hamid Taebi
                      wrote on last edited by
                      #10

                      And see A Registry Class[^] if does any help.

                      A 1 Reply Last reply
                      0
                      • H Hamid Taebi

                        And see A Registry Class[^] if does any help.

                        A Offline
                        A Offline
                        Ajay L D
                        wrote on last edited by
                        #11

                        Thanks everyone for the replies! :-)

                        H 1 Reply Last reply
                        0
                        • A Ajay L D

                          Thanks everyone for the replies! :-)

                          H Offline
                          H Offline
                          Hamid Taebi
                          wrote on last edited by
                          #12

                          If you think my answer wasn helpful you can give me vote. ;P

                          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