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. Visual Basic
  4. Run Registry Value

Run Registry Value

Scheduled Pinned Locked Moved Visual Basic
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.
  • C Code Crapper

    I have had some trouble with this one. How can I Display the contents of the Run Registry value in a textbox? Just incase you are wondering, this key is located in the registry at: HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run

    C Offline
    C Offline
    Christian Graus
    wrote on last edited by
    #2

    MessageBox.Show. Reading the registry is also widely documented.

    Christian Graus - C++ MVP

    C 1 Reply Last reply
    0
    • C Christian Graus

      MessageBox.Show. Reading the registry is also widely documented.

      Christian Graus - C++ MVP

      C Offline
      C Offline
      Code Crapper
      wrote on last edited by
      #3

      Thanks on the quick reply, how would I use message box.Show to display it? like this? Messagebox.show ("HKEY_L...") ? sorry I am allmost certain that is wrong as that just displays text. :sigh:

      C 1 Reply Last reply
      0
      • C Code Crapper

        I have had some trouble with this one. How can I Display the contents of the Run Registry value in a textbox? Just incase you are wondering, this key is located in the registry at: HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #4

        HI, This Code to Reading fro registry

        Imports Microsoft.Win32
        
        Registry.LocalMachine.OpenSubKey("SOFTWARE", True).OpenSubKey("Microsoft", True).OpenSubKey("Windows", True).OpenSubKey("CurrentVersion", True).OpenSubKey("run",True).GetValue(OBJECTNAME>
        

        _The _**OBJECTNAME**_ must be replaced by value name in the Key (RUN) e.g. "TkBellExe" Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net & VB.net Developer _

        C 1 Reply Last reply
        0
        • C Code Crapper

          Thanks on the quick reply, how would I use message box.Show to display it? like this? Messagebox.show ("HKEY_L...") ? sorry I am allmost certain that is wrong as that just displays text. :sigh:

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #5

          My point was that even if you typed the question in to google as you typed it here, you'd probably find heaps of articles on how to read the registry.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

          1 Reply Last reply
          0
          • L Lost User

            HI, This Code to Reading fro registry

            Imports Microsoft.Win32
            
            Registry.LocalMachine.OpenSubKey("SOFTWARE", True).OpenSubKey("Microsoft", True).OpenSubKey("Windows", True).OpenSubKey("CurrentVersion", True).OpenSubKey("run",True).GetValue(OBJECTNAME>
            

            _The _**OBJECTNAME**_ must be replaced by value name in the Key (RUN) e.g. "TkBellExe" Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net & VB.net Developer _

            C Offline
            C Offline
            Code Crapper
            wrote on last edited by
            #6

            Thanks for the code snippit and for Chris, I know how to read and write to the registry AND I also know what messagebox.Show does EXACTLY but how is that gonna help me, my question was How can I display the contents of the RUN registry key in a TEXTBOX (thats already on the form) not a message box, I know how to display registry VALUES in a textbox but I do not know how to display the entire contents of a registry SUBKEY. :doh:

            C L 2 Replies Last reply
            0
            • C Code Crapper

              Thanks for the code snippit and for Chris, I know how to read and write to the registry AND I also know what messagebox.Show does EXACTLY but how is that gonna help me, my question was How can I display the contents of the RUN registry key in a TEXTBOX (thats already on the form) not a message box, I know how to display registry VALUES in a textbox but I do not know how to display the entire contents of a registry SUBKEY. :doh:

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

              Since the registry has a tree structure, maybe the textbox is not the best idea... :):-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.

              C 1 Reply Last reply
              0
              • C CPallini

                Since the registry has a tree structure, maybe the textbox is not the best idea... :):-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.

                C Offline
                C Offline
                Code Crapper
                wrote on last edited by
                #8

                Uh, ye thanks... :)... lol Would you recommend a Treeview then? if so I would need to know how as I have never worked with the Tree view control. thanks

                C 1 Reply Last reply
                0
                • C Code Crapper

                  Uh, ye thanks... :)... lol Would you recommend a Treeview then? if so I would need to know how as I have never worked with the Tree view control. thanks

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

                  SLRGrant wrote:

                  Would you recommend a Treeview then?

                  Yes! MSDN is your good friend, there are samples about populating TreeViews. :)

                  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.

                  1 Reply Last reply
                  0
                  • C Code Crapper

                    I have had some trouble with this one. How can I Display the contents of the Run Registry value in a textbox? Just incase you are wondering, this key is located in the registry at: HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/Run

                    X Offline
                    X Offline
                    Xiuzhu Lian
                    wrote on last edited by
                    #10

                    The RegEnumValue function enumerates the values for the specified open registry key。 For more detail about how to use "RegEnumValue", go to MSDN library for help! This is the URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regenumvalue.asp[^] Please forgive me for my poor English, but I'm a Chinese student!:laugh:

                    Hakuna Matata! What a wonderful phrase!

                    C 1 Reply Last reply
                    0
                    • C Code Crapper

                      Thanks for the code snippit and for Chris, I know how to read and write to the registry AND I also know what messagebox.Show does EXACTLY but how is that gonna help me, my question was How can I display the contents of the RUN registry key in a TEXTBOX (thats already on the form) not a message box, I know how to display registry VALUES in a textbox but I do not know how to display the entire contents of a registry SUBKEY. :doh:

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #11

                      i think that u want to display the values entire the "RUN" Key if this correct ,try this code Registry.LocalMachine.OpenSubKey("SOFTWARE", True).OpenSubKey("Microsoft", True).OpenSubKey("Windows", True).OpenSubKey("CurrentVersion", True).OpenSubKey("run", True).GetValueNames() the GetValueNames() return the names of all values in key then u can read the value by using the getvalue("ObjectName") method then u can display them in any way u like

                      Mohamad A. Flefel mflefel@hotmail.com +962 79 5963865 C#.net & VB.net Developer

                      1 Reply Last reply
                      0
                      • X Xiuzhu Lian

                        The RegEnumValue function enumerates the values for the specified open registry key。 For more detail about how to use "RegEnumValue", go to MSDN library for help! This is the URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regenumvalue.asp[^] Please forgive me for my poor English, but I'm a Chinese student!:laugh:

                        Hakuna Matata! What a wonderful phrase!

                        C Offline
                        C Offline
                        Code Crapper
                        wrote on last edited by
                        #12

                        yay, thank you for the help guys, I should be fine from here :-D

                        --------------------------- If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.

                        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