How to get path to dll being run by SvcHost.exe in a C# program

Dave Cotton 41 Reputation points
2022-03-21T17:50:07.487+00:00

I'm writing a service monitor program, I want to be able to record the version of the service being run. For those services run under SvcHost I want to know the full path to the DLL that SvcHost is hosting. I want the version of the DLL not the version of SvcHost.

The results returned by the WMI search Win32_Service are inconclusive. And I'm not finding the correct entry in the registry (assuming it exists).

Would appreciate some help, Thanks,
Nottoc

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,010 questions
{count} votes

Accepted answer
  1. RLWA32 45,701 Reputation points
    2022-03-21T18:14:18.133+00:00

    The service information is in the registry.

    Registry Key - HKLM\SYSTEM\CurrentControlSet\Services\<svcname>\Parameters
    Value - ServiceDll

    For example, process explorer shows for the CoreMessaging Service in svchost.exe -

    185290-svchost.png

    Registry editor -

    185355-registry.png

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.