Subscribe to Windows IT Pro
November 01, 2002 12:00 AM

How can I stop Windows from caching a .dll file after I close the program that was accessing it?

Windows IT Pro
InstantDoc ID #27128
Rating: (0)

A. Windows caches Windows Explorer and shell-extention .dll files to save disk I/O. However, even after you close the calling program, the.dll file remains cached. To stop Windows from caching .dll files after you've closed the calling program, perform the following steps:

  1. Start a registry editor (e.g., regedit.exe).
  2. Navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer registry subkey.
  3. From the Edit menu, select New, DWORD Value.
  4. Enter the name AlwaysUnloadDLL, then press Enter.
  5. Double-click the new value, set it to 1, then click OK.
  6. Close the registry editor, then reboot the machine for the change to take effect.

A shell-extension .dll is one that provides a shell-namespace extension or menu extension (e.g., WinZip's extension .dll lets you easily compress folders from a context menu item in Windows Explorer). By default, Windows Explorer loads shell-extension .dll files and keeps them loaded, even when they aren't being directly accessed (e.g., the namespace they provide isn't being used and no menus are active). Note that Windows Explorer is an active application and uses .dll files. The registry value simply has Windows Explorer unload these .dll files when not in use, which is useful for developers of such .dll files who want to test, fix, and retest their .dll files without having to restart Windows Explorer. Thanks to Mark Russinovich for his help with this FAQ.

Related Content:

ARTICLE TOOLS

Comments
  • Wayne Scott
    8 years ago
    May 19, 2004

    Is there a way to force the explorer to unload a given DLL? In other words can I write an uninstaller for an explorer shell extension that doesn't require a reboot?

  • Gennady Nesanelis
    10 years ago
    Nov 06, 2002

    John,

    At least on one of our PC I found AlwaysUnloadDLL set not as DWORD value set to 1 to the HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer subkey but as a subkey to the Explorer subkey with the default value set to "1" (DWORD). Does it really matter?

    Thank you,

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.