Skip navigation

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

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.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.