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

John Savill

October 31, 2002

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorer 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.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like