Results 1 to 7 of 7

Thread: VB6 - RegOpen - open specified paths in the registry editor

Hybrid View

  1. #1

    Thread Starter
    Addicted Member adamm83's Avatar
    Join Date
    Oct 2005
    Location
    Toronto, ON, Canada
    Posts
    180

    VB6 - RegOpen - open specified paths in the registry editor

    Hey ppl,
    I made a nice little vb app that opens paths in the registry editor.

    So lets say you enter:
    Code:
    REGOPEN HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Drive
    it will open regedit to that key.

    It has the ability to run from a dos prompt using parameters. You can also run it from the Run command (Start > Run) or run it manually by opening the exe file and typing the path of the key in the registry.

    --- START EDIT: Added description of functionality: ---
    My code works by editing the LastKey value from the registry located at:
    Code:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit
    When opening the Registry Editor, regedit.exe looks for the LastKey value and opens the registry editor to the key in that value. It is sort of like a "Remember the last key opened" function. I based this whole program around that value.

    First, the program changes the LastKey value in the registry using the specified path. Then it checks if regedit.exe is open/running. If so, it closes regedit.exe and re-runs regedit.exe. Since the LastKey value was changed to the specified key, regedit will now open, showing that key! Very simple, yet effective.
    --- END EDIT ---

    I found that I needed the function very often and regedit does not have it. All I do is put the exe in the C:\WINDOWS directory (right next to regedit.exe). This way I don't have to enter the path of the executable when I want to run it from the Run menu. It's very convenient and compact and the UI only shows when you want it to show (when you double click the exe, or when you run regopen without any parameters). I have applied XP styles directly to the compiled program. There is no extra .res file, bc it is compiled right into the exe.

    I hope this is as much use to you as it is to me. The source is included. There are no extra components needed, just a few scripting references (which you should have on your computers already):

    Windows Script Host Object Model
    Microsoft Scripting Runtime
    Microsoft WMI Scripting V1.2 Library

    Enjoy!

    Screenshot:


    RegOpen v1.01
    Attached Files Attached Files
    Last edited by adamm83; Feb 24th, 2007 at 03:08 PM.
    adamm
    ACM Designs

    Codebank:
    RegOpen - Open registry keys in Regedit quick & easily


    "A man who tries to catch two rabbits at the same time will catch neither."

  2. #2

    Thread Starter
    Addicted Member adamm83's Avatar
    Join Date
    Oct 2005
    Location
    Toronto, ON, Canada
    Posts
    180

    Re: VB6 - RegOpen - open specified paths in the registry editor

    hey ppl,
    please feel free to post opinions about my app. I would like to hear from you guys about what you think about it!!

    thanks!
    adamm
    ACM Designs

    Codebank:
    RegOpen - Open registry keys in Regedit quick & easily


    "A man who tries to catch two rabbits at the same time will catch neither."

  3. #3
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: VB6 - RegOpen - open specified paths in the registry editor

    Regedit has a "Favourites" menu........

  4. #4

    Thread Starter
    Addicted Member adamm83's Avatar
    Join Date
    Oct 2005
    Location
    Toronto, ON, Canada
    Posts
    180

    Re: VB6 - RegOpen - open specified paths in the registry editor

    yeah but that's extra clicking. Plus, the main function of my program is not opening favourite shortcuts to paths in the registry, it's for opening paths (sometimes long paths) that you would normally have to click manually. Sometimes (in my case, enough times for me to write a program), I encounter a website that has a registry path that I would like to access, and in order to avoid opening regedit and manually going to the path, all I have to do is copy the path from the page and go to start > run and type:
    Code:
    regopen [then\paste\the\path\here]
    That is the main function of my app. I admit, very specific, but very useful if you have the need for it. The shortcuts are an added feature that I was able to code into it, but like you said is not neccessary since Regedit has a Favourites menu. Although normally when I'm working manually in regedit, I try to avoid using my mouse because it's more of a hassle. All I use are the arrow keys to navigate through the structure, and the letters/numbers to find a specific key.
    Last edited by adamm83; Jun 21st, 2007 at 09:22 PM.
    adamm
    ACM Designs

    Codebank:
    RegOpen - Open registry keys in Regedit quick & easily


    "A man who tries to catch two rabbits at the same time will catch neither."

  5. #5
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: VB6 - RegOpen - open specified paths in the registry editor

    Good work !
    In case someone doesn't want to add any external reference or doesn't want to use any API, same can be done by a batch file.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  6. #6

    Thread Starter
    Addicted Member adamm83's Avatar
    Join Date
    Oct 2005
    Location
    Toronto, ON, Canada
    Posts
    180

    Re: VB6 - RegOpen - open specified paths in the registry editor

    Yeah I experimented with that before I decided to create this program. In the end, i found that there were some limitations with the batch file.

    1) If regedit is open, and I run the batch file to open a specific key/path, it will not open that key. With my application, it will detect if regedit is running, close it, then open it again in the correct key. When changing the LastKey value (located here: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit), while regedit is open, it only works if Regedit is closed then opened again. This is why the batch file does not fully work.

    2) not so important, but an ugly black dos screen flashes. Not attractive.

    3) There are more possibilities to add features onto my program when needed. With the batch file, it is very limited. Albeit, there is much less code in the batch file to accomplish almost the same thing as my program (minus some extra functionality), but the resulting compiled exe is only 40kb and uses next to no resources. It runs, opens regedit to the key you specified, then closes immediately (unless you select the checkbox to keep it open)

    4) the batch has no gui.

    5) it's hard to paste a key location into a dos input screen; and it's tedious to open a batch file and paste a new location, save it, and run it. My program allows you to do this within the interface very easily.

    6) It also trims the whitespace from the string pasted just in case you picked up some when copying it.
    Last edited by adamm83; Aug 17th, 2007 at 09:51 AM.
    adamm
    ACM Designs

    Codebank:
    RegOpen - Open registry keys in Regedit quick & easily


    "A man who tries to catch two rabbits at the same time will catch neither."

  7. #7

    Thread Starter
    Addicted Member adamm83's Avatar
    Join Date
    Oct 2005
    Location
    Toronto, ON, Canada
    Posts
    180

    Re: VB6 - RegOpen - open specified paths in the registry editor

    I've recently created a Firefox and IE extension for this application. So you can right-click a path in either browser and open it directly in Regedit from the browser. I'm just putting some finishing touches fixing some minor issues on them. I'll post either links to the extensions or attach them here, if anyone is interested.
    adamm
    ACM Designs

    Codebank:
    RegOpen - Open registry keys in Regedit quick & easily


    "A man who tries to catch two rabbits at the same time will catch neither."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width