Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8399237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:14:51+00:00 2026-06-09T21:14:51+00:00

I have a dll when its software gets installed, it gets installed in HKEY_LOCAL_MACHINE\\SOFTWARE

  • 0

I have a dll when its software gets installed, it gets installed in

HKEY_LOCAL_MACHINE\\SOFTWARE for 32-bit OS and

HKEY_CURRENT_USER\\SOFTWARE for 64-bit OS.

How do i detect the dll path based on the registry key ?

I don’t want to hard code like this.

RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("Software//NodeName")

I can try detecting 32-bit or 64-bit OS and do something like

If 32-bit

RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("Software//NodeName")

If 64-bit

RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software//NodeName")

But is there a way i can detect the path of the dll directly if for example the dll name is specified and how do i do an entire registry check and find its path name?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:14:53+00:00Added an answer on June 9, 2026 at 9:14 pm

    HKEY_CLASSES_ROOT\CLSID contains the list of all registered COM files (.ocx,.dll, .ax) on the system no matters if is 32 or 64 bits.

    The key under CLSID is represented by the generated GUID of each COM.

    And finaly into the GUID key, there is the InprocServer32 sub-key, in it, the default value contains the path of the COM file into the sistem so you can find it as follows:

    VB CODE:

        ''' <summary>
        ''' Search and Find Registry Function
        ''' </summary>
        Public Shared Function SearchRegistry(ByVal dllName As String) As String
    
            'Open the HKEY_CLASSES_ROOT\CLSID which contains the list of all registered COM files (.ocx,.dll, .ax) 
            'on the system no matters if is 32 or 64 bits.
            Dim t_clsidKey As RegistryKey = Registry.ClassesRoot.OpenSubKey("CLSID")
    
            'Get all the sub keys it contains, wich are the generated GUID of each COM.
            For Each subKey In t_clsidKey.GetSubKeyNames.ToList
    
                'For each CLSID\GUID key we get the InProcServer32 sub-key .
                Dim t_clsidSubKey As RegistryKey = Registry.ClassesRoot.OpenSubKey("CLSID\" & subKey & "\InProcServer32")
    
                If Not t_clsidSubKey Is Nothing Then
    
                    'in the case InProcServer32 exist we get the default value wich contains the path of the COM file.
                    Dim t_valueName As String = (From value In t_clsidSubKey.GetValueNames() Where value = "")(0).ToString
    
                    'Now gets the value.
                    Dim t_value As String = t_clsidSubKey.GetValue(t_valueName).ToString
    
    
                    'And finaly if the value ends with the name of the dll (include .dll) we return it
                    If t_value.EndsWith(dllName) Then
    
                        Return t_value
    
                    End If
    
                End If
    
            Next
    
            'if not exist, return nothing
            Return Nothing
    
        End Function
    

    C# CODE:

        /// <summary>
        /// Search and Find Registry Function
        /// </summary>
        public static string SearchRegistry(string dllName)
        {
    
            //Open the HKEY_CLASSES_ROOT\CLSID which contains the list of all registered COM files (.ocx,.dll, .ax) 
            //on the system no matters if is 32 or 64 bits.
            RegistryKey t_clsidKey = Registry.ClassesRoot.OpenSubKey("CLSID");
    
            //Get all the sub keys it contains, wich are the generated GUID of each COM.
    
            foreach (object subKey_loopVariable in t_clsidKey.GetSubKeyNames.ToList) {
                subKey = subKey_loopVariable;
                //For each CLSID\GUID key we get the InProcServer32 sub-key .
                RegistryKey t_clsidSubKey = Registry.ClassesRoot.OpenSubKey("CLSID\\" + subKey + "\\InProcServer32");
    
    
                if ((t_clsidSubKey != null)) {
                    //in the case InProcServer32 exist we get the default value wich contains the path of the COM file.
                    string t_valueName = (from value in t_clsidSubKey.GetValueNames()where string.IsNullOrEmpty(value))(0).ToString;
    
                    //Now gets the value.
                    string t_value = t_clsidSubKey.GetValue(t_valueName).ToString;
    
    
                    //And finaly if the value ends with the name of the dll (include .dll) we return it
    
                    if (t_value.EndsWith(dllName)) {
                        return t_value;
    
                    }
    
                }
    
            }
    
            //if not exist, return nothing
            return null;
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to create a wrapper DLL that exports some symbols (functions). Within its
I have made a small software in qt and its only one executable and
I have a DLL with its import library. When I try to reference the
I have an DLL that has this in its h file: extern C __declspec(dllexport)
I have a DLL which exectues some code at its entry point, i.e. procedure
Let's say I have a library Lib.dll, which uses Castle.Windsor to initialize its services.
i have given a chance to my software user to select dll from openfile
We have a library created as both .lib and .dll (it's a big library
I have a VB6 app that utilizes a non-activeX DLL (non-registering). It's declared via
I have the .def file, .lib file, the .dll, the source files. It's using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.