Thumbs db open in Windows Explorer

Issue

Cannot delete certain folders from a network share from Windows 10 Pro desktop. The folders cannot be deleted because they contain hidden Thumbs.db files which are locked by Windows Explorer (these files are used to speed up the display of image thumbnails in  Windows Explorer icon view). Following error message pops up when trying to delete affected folders.

Thumbs db open in Windows Explorer

File In Use
The action can't be completed because the file is open in Windows Explorer
Close the file and try again.
Thumbs.db
Type: Data Base File

Resolution

The issue can be temporarily resolved by restarting explorer.exe process, or just waiting until the lock on Thumbs.db file is eventually released. A more permanent solution is preventing Windows Explorer from creating and using Thumbs.db files on network shares. This can be done in the following way:

  • Open Local Group Policy Editor (gpedit.exe)
  • Navigate to User Configuration > Administrative Templates > Windows Components > Windows Explorer
  • Enable Policy called: "Turn off the caching of thumbnails in hidden thumbs.db files"
  • Restart explorer.exe process.

 

Thumbs db open in Windows Explorer

November 2020
Windows 10 Pro
Synology DiskStation NAS

Hannah has her system configured to display hidden files. (As she says, she likes to see what is really on her hard drive.) Hannah noticed that a lot of folders have a common hidden file in them: Thumbs.db. She knows that these weren't files that she created, so she figured that either Windows or some program on her system was creating them.

Thumbs.db is a (typically) hidden file that contains thumbnail images to represent picture files in a folder. This file is automatically built when you access a folder that contains pictures so that the thumbnails can be cached and the folder contents displayed more quickly (after the first time). Unfortunately, Thumbs.db is often kept open by Windows, thus preventing you from deleting the folder that contains the file.

You can both get rid of Thumbs.db files as well as prevent them from being created in the first place so as to avoid any problems in the future. Deleting Thumbs.db is perfectly safe—there is no harm in doing so—because Windows will simply recreate the file if it doesn't exist.

In order to see if you even have the Thumbs.db file in a folder, you must first ensure that the folder's setting is such that you can see hidden files, just as Hannah did. If you are using Windows 7 you do this by navigating to the folder, clicking Tools | Folder Options to display the Folder Options dialog box. If you are using Windows 8 you display the same dialog box by displaying the Control Panel, clicking the Appearance and Personalization link, and then clicking the Show Hidden Files and Folder link (under the Folder Options section). If you are using Windows 10 you display the same dialog box by opening File Explorer, click on the View tab of the ribbon and then on the Options button.

Once the Folder Options dialog box is displayed, click the View tab. (See Figure 1.)

Thumbs db open in Windows Explorer

Figure 1. The View tab of the Folder Options dialog box.

In the Advanced Settings list there is a Files and Folders category under which is a "Hidden Files and Folders" category. Under there are two radio buttons. Click the one named "Show Hidden Files, Folders, and Drives" and click OK. If there is a Thumbs.db file in a folder, you will now see it.

At this point you can treat it like any other file—simply right-click on it and choose to delete it. If you cannot delete the file (Windows won't let you) it is most likely because Windows has the file open. Why would it be open? Because there might be images in the folder for which Windows is displaying thumbnails. In such a case you might not be able to delete the file until you move all the images out of the folder and then, possibly, restarting your system. (Restarting forces Windows to close the Thumbs.db file and it won't reopen the file when you again display the folder because there are no images in the folder requiring the thumbnails.)

If you want to configure your system so that it doesn't use Thumbs.db files, you can do so via the Local Group Policy Editor. This tool is available only in some versions of Windows. To see if it is available in yours, invoke Windows' search capability and search for "gpedit.msc" (without the quotes). If Windows finds it, double-click it to start the editor.

Using the left-side navigation pane, expand the various levels for User Configuration | Administrative Templates | Windows Components | File Explorer. (Actually, it is Windows Explorer in Windows 7; in Windows 8 and Windows 10 you want to select File Explorer. Microsoft renamed Windows Explorer to File Explorer when it released Windows 8.) If you are using Windows 7, click the setting in the right pane titled "Turn Off the Caching of Thumbnails in Hidden Thumbs.db Files." If you are using Windows 8 or Windows 10, click the setting titled "Turn Off Caching of Thumbnail Pictures." (See Figure 2.)

Thumbs db open in Windows Explorer

Figure 2. The Local Group Policy Editor dialog box.

If you double-click this setting another dialog box opens, allowing you to enable or disable it. If you don't want the system to use Thumbs.db files, leave the setting as "Not configured." If you don't want your system to use Thumbs.db files, then enable the setting from the dialog box and click OK.

Thumbs db open in Windows Explorer
Thumbs db open in Windows Explorer
Thumbs db open in Windows Explorer
 This tip (12162) applies to Windows 7, 8, and 10.

Author Bio

Barry has been a computer professional for over 35 years, working in different positions such as technical team leader, project manager, and software developer. He is currently a software engineer with an emphasis on developing custom applications under Microsoft Windows. When not working with Windows or writing Tips, Barry is an amateur writer. His first non-fiction book is titled "A Chronological Commentary of Revelation." Learn more about Barry...

MORE FROM BARRY

Removing an Update

Windows installs updates automatically by default. If you want to remove an update, this tip tells you how.

Discover More

How the Registry is Organized

There may come a time when you need to view or even modify the registry. In such a case, it's good to know how the ...

Discover More

Using the Hosts File to Block Content

Although there are better methods, you can use the Hosts file to block access to specific websites. This tip tells you how.

Discover More

Can't delete thumbs db open in Windows Explorer?

db file, use these steps:.
Open File Explorer on Windows 10..
Navigate to the folder you want to delete..
Click the View tab..
Check the Hidden items option..
Under the “Layout” section, select the Details view option..
Select the thumbs. db file. ... .
Click the Delete button from the “View” tab..
Click the Yes button..

How do I view thumbs db files in Windows 10?

db files from your computer, do the following:.
Click the Start button and select Search, then For Files or Folders.....
In the "All or part of the file name:" field, type: thumbs.db..
In the "Look in:" drop-down menu, select Local Hard Drives (C:)..
Click Search. A list of thumbs. ... .
Select all of the thumbs..

How do I open a thumbs db file?

You can open a Thumbs. db file to read from your computer or your Google Drive and download the extracted images as Zip file.

How do I turn off thumbs db in Windows 10?

Let us follow these steps and check if this helps..
Press “Windows key + X” and click on “Control Panel”..
Double click on “Folder Options”..
Click the “View tab”..
Uncheck the following option, “Display file icons on thumbnails”..
"Always show icons, never thumbnails"..
Click on Apply and OK..