6.9. Viewing the DLLs Being Used by a Process

Problem

You want to view the DLLs being used by a process or find the processes using a specific DLL. This can come in handy if you need to update a DLL and want to find out which programs are actively using it, or if you are trying to delete a DLL, but cannot due to a lock on the file by a process that is using it.

Solution

Using a graphical user interface

To view the DLLs being used by a process, do the following:

  1. Open the Sysinternals Process Explorer tool (procexp.exe).

  2. From the menu, select View Lower Pane View DLLs.

  3. Click on the process you want to view. In the bottom window, the list of DLLs being used by that process is displayed.

To view the processes using a specific DLL, do the following:

  1. Open the Sysinternals Process Explorer tool (procexp.exe).

  2. From the menu, select Find Find DLLs.

  3. Type the name of the DLL (partial string accepted) and click the Search button.

Using a command-line interface

To view the DLLs being used by a process, use the following command:

> listdlls <ProcessName>

To view the processes using a specific DLL, use the following command:

> listdlls -d <DLLName>

Using VBScript

There are no scripting interfaces available to get this information. To get it programmatically, you must use the Win32 API or .NET Framework, or shell out to the listdlls utility.

Discussion

Ever visited DLL hell? Things aren't as bad as they once were in the early days of Windows NT, but keeping track of DLL versions for certain applications can ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.