• Store Filenames in database from Explorer (VB6)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Store Filenames in database from Explorer (VB6)

    Author
    Topic
    #412181

    I have a requirement to store filenames and paths in an Access database.
    The code to write the data in is very simple.
    However it is needed to be activated from within explorer.
    How easy is it and can anyone give me any pointers (excuse the pun)
    as to
    1. Integrating a utility like this into the explorer window
    It happens all the time with applications like winzip etc
    2. Getting it to recognize the file path and name from this location.

    If I was writing it from within the database it would be simple.

    Thanks

    Viewing 4 reply threads
    Author
    Replies
    • #899257

      I think you’re looking for documentation on creating a Shell Extension. Not something I’ve ever programmed, although I have read about it from time to time.

    • #904243

      Rule #1. The registry is your friend.
      Rule #2. To really customize windows, you must modify the registry
      Rule #3. If Rules 1 and 2 mess up your machine, you can always reinstall the OS. grin

      Okay, seriously, one of the reasons I love the Lounge is because I always find a post that let’s me just plain experiment. Here’s how to do what you want. Take your VB .exe. I wrote a simple one like this:

      Sub Main()
      msgbox “””” & Command & “”””
      End Sub

      I called it filetest.exe, and compiled it to the root of my C: drive.

      Then, go into your registry (and here is where all warranties and promises go away, do this at your own risk! wink). Find HKEY_CLASSES_ROOTAllFilesystemObjects
      If there is not a key called ‘shell’ (no quotes), then add it. Under the new (or old) shell key, add a new key with the name of the text you want displayed at the top of the ‘right click’ shortcut menu. In my instance, I used Test VB. Then add a key under that new key called ‘Command’ (no quotes). In the default value of that key, I put ‘C:filetest.exe *1’ (again, no quotes, and replace the * asterick with a percent symbol. It’s not posting on the lounge right, so I had to change it!). Now, on every file and folder in Windows explorer, I get a Test VB option in my shortcut menu. Clicking on it displays the full path of the file/folder I am over.

      So, in summation, you would have this displayed in regedit:

      HKEY_CLASSES_ROOT
      AllFilesystemObjects
      shell
      Your Custom Process Name
      Command

      Hope this helps. sailing

    • #904244

      Rule #1. The registry is your friend.
      Rule #2. To really customize windows, you must modify the registry
      Rule #3. If Rules 1 and 2 mess up your machine, you can always reinstall the OS. grin

      Okay, seriously, one of the reasons I love the Lounge is because I always find a post that let’s me just plain experiment. Here’s how to do what you want. Take your VB .exe. I wrote a simple one like this:

      Sub Main()
      msgbox “””” & Command & “”””
      End Sub

      I called it filetest.exe, and compiled it to the root of my C: drive.

      Then, go into your registry (and here is where all warranties and promises go away, do this at your own risk! wink). Find HKEY_CLASSES_ROOTAllFilesystemObjects
      If there is not a key called ‘shell’ (no quotes), then add it. Under the new (or old) shell key, add a new key with the name of the text you want displayed at the top of the ‘right click’ shortcut menu. In my instance, I used Test VB. Then add a key under that new key called ‘Command’ (no quotes). In the default value of that key, I put ‘C:filetest.exe *1’ (again, no quotes, and replace the * asterick with a percent symbol. It’s not posting on the lounge right, so I had to change it!). Now, on every file and folder in Windows explorer, I get a Test VB option in my shortcut menu. Clicking on it displays the full path of the file/folder I am over.

      So, in summation, you would have this displayed in regedit:

      HKEY_CLASSES_ROOT
      AllFilesystemObjects
      shell
      Your Custom Process Name
      Command

      Hope this helps. sailing

      • #904366

        AWESOME!

        And so simple too.
        I’ve been trawling books about shell programming in VB and C++ (Nightmare)
        They have long solutions that involve assorted API function calls.

        But this is such a neat answer.
        And all I needed, from that return string I can get all the information I need.

        Many Thanks.

      • #904367

        AWESOME!

        And so simple too.
        I’ve been trawling books about shell programming in VB and C++ (Nightmare)
        They have long solutions that involve assorted API function calls.

        But this is such a neat answer.
        And all I needed, from that return string I can get all the information I need.

        Many Thanks.

    • #904419

      Andrew

      Along similar lines to Drew’s reply, there are numerous utilities around that can do the registry “dirty work” for you, when adding to Explorer’s context menu. For example:

      CONTEXT MENU EXTENDER………. CMenuExtender is a shell extension that lets the user add items to the Explorer context menu. Using any registry-editor or the supplied GUI, the user can add submenus and items such as shortcuts to programs, documents, folders, webpages and scripts. CMExt also has some predefined commands for copying, moving and retrieving information on files and directories….. free…..!

      Alan

    • #904420

      Andrew

      Along similar lines to Drew’s reply, there are numerous utilities around that can do the registry “dirty work” for you, when adding to Explorer’s context menu. For example:

      CONTEXT MENU EXTENDER………. CMenuExtender is a shell extension that lets the user add items to the Explorer context menu. Using any registry-editor or the supplied GUI, the user can add submenus and items such as shortcuts to programs, documents, folders, webpages and scripts. CMExt also has some predefined commands for copying, moving and retrieving information on files and directories….. free…..!

      Alan

    Viewing 4 reply threads
    Reply To: Store Filenames in database from Explorer (VB6)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: