Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / How to Disable/Remove Thumbs.db File on Network Folders in Windows?

February 27, 2023 Group PoliciesWindows 10Windows Server 2016

How to Disable/Remove Thumbs.db File on Network Folders in Windows?

Thumbs.db is a hidden system file that is automatically created by Windows Explorer (File Explorer) in all folders containing image and video files. File Explorer creates thumbnails of the images in the directory and saves them to the thumbs.db file (a COM structured storage). Thanks to the thumbs.db file, Windows Explorer doesn’t need to create thumbnails every time the user browses the folder. By using the cache, the time it takes to load and display thumbnail files in File Explorer is greatly reduced.

However, the thumbs.db file can cause some problems for system administrators and users, especially when used on shared network folders. In this article, we’ll take a look at whether it is possible to delete/disable creation of the thumbs.db file on Windows.

Contents:
  • What is Thumbs.db File on Windows?
  • Unable to Delete Network Shared Folder Because Thumbs.db is in Use
  • Disable Thumbs.db Generation on Network Drives using GPO
  • Disable Thumbs.db File Creation on Network Shares via Registry
  • Recursively Delete Thumbs.db on Shared Folder using PowerShell

What is Thumbs.db File on Windows?

Windows File Explorer saves information about thumbnails (small copies of images) of jpeg, bmp, gif, tif, pdf, html files and some video files to thumbs.db file. By default the thumbs.db file is hidden and doesn’t show in the File Explorer. The size of the thumbs.db file depends on the number of image files in the folder.

thumbs.db file on network shared folder windows 10

Note that even if you delete the image file from the folder, its thumbnail will remain in the thumbs.db file.

In Windows 10 the thumbs.db file is generated only for shared network folders. The thumbs.db file is not created for local image directories and the thumbnail cache for File Explorer is stored in the user profile %LOCALAPPDATA%\Microsoft\Windows\Explorer as thumbcache_xxxx.db files.

local thumbnail cache on window10 user profile thumbcache_xxxx.db

If your Windows 10 doesn’t display icons or thumbnails correctly, you can reset this cache.

The thumbs.db file can be safely deleted manually. It will be automatically recreated the next time you view the thumbnails of the files in the folder. However, you can prevent Windows 10 File Explorer from creating the thumbs.db file.

The easiest way to do this is from the File Explorer settings menu:

  1. Press the keyboard shortcut Win+E;
  2. Go to the View tab and select Options;
  3. Enable the “Always show icons, never thumbnails” option in Advanced Settings of the View tab.

file explorer disable thumbnails

If you need to disable thumbnail creation on all computers in the domain, use Group Policy. More on this below.

Unable to Delete Network Shared Folder Because Thumbs.db is in Use

There is one common problem in network folders related to the use of the thumbnail caching by Windows File Explorer. You may notice that immediately after copying/moving the image directory in the network folder on the file server, Windows doesn’t allow you to delete or rename the directory. You could only rename or delete this folder only after a certain time (1-5 minutes).

When trying to delete this network share, the following error appeared:

Folder In Use
The action can’t be completed because the folder or a file in it is open in another program.
Close the file or folder and try again.

Can't delete folder because thumbs.db file is in use

The issue is related to a known issue described by Microsoft in the KB2025703  (Renaming a network folder in Windows Explorer fails with “the action can’t be completed”). The article states that sometimes the presence of a thumbs.db file with a thumbnail cache can prevent deleting or renaming network folders.

It looks like Windows is taking a while to create the thumbnail cache file.While this file is being created or updated, you cannot do anything with its parent directory until the thumbcache.dll process unlocks the thumbs.db file handle.

In this case, you can turn off the automatic generation of the thumbs.db file for network folders and drives.

Disable Thumbs.db Generation on Network Drives using GPO

To prevent Windows File Explorer from creating a hidden thumbnail cache (Thumbs.db fil)e when browsing folders, you can use a GPO.

    1. Run the local GPO editor (gpedit.msc) or create a domain GPO using the gpmc.msc console;
    2. Go to the following Group Policy section User Configuration -> Administrative Templates -> Windows Components -> File Explorer;
    3. This section has three options that allow you to manage the creating of the thumbs.db file by File Explorer:
      • Turn off the display of thumbnails and only display icons on network folders (prevents thumbs.db file from being created on shared network folder)
      • Turn off caching of thumbnails in hidden thumbs.db files
      • Turn off the display of thumbnails and only display iconsgroup policy - turn off thumbnails caching on network folders
    4. Enable all three policies by changing their values to Enabled;
  1. It remains to link the Group Policy to users (if you use domain GPOs) and update it on domain computers. To apply the policy settings immediately, run the command: gpupdate /force
If you have prevented Windows from creating a thumbnail image cache file in folders, Windows has to load the image files and generate thumbnails each time, which is resource consuming. As a result, creating thumbnails of images will take much longer (especially in case of folders containing a lot of images).

Disable Thumbs.db File Creation on Network Shares via Registry

In Home editions of Windows without the local GPO Editor, you can disable the creation of hidden thumbs.db files in shared network folders using the Registry Editor (regedit.exe).

To do it, create a new registry key Explorer under the HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\, and create a REG_DWORD parameter with the name DisableThumbsDBOnNetworkFolders and the value 1.

DisableThumbsDBOnNetworkFolders

The same operation can be done with a single command:

reg add "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v DisableThumbsDBOnNetworkFolders /d 0x1 /t REG_DWORD /f

Recursively Delete Thumbs.db on Shared Folder using PowerShell

The existing Thumbs.db files are not automatically removed from the shared folders after you enable the policy. You can recursively delete all Thumbs.db files on a specific drive or in a network folder using PowerShell.

Go to the folder you need (UNC paths supported):

cd \\mun-fs01\Public\Photo
To list all Thumbs.db files in subfolders, run:
Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force | Remove-Item –Force –WhatIF
delete thumbs.db files from network drive using powershell
Recursively delete the found thumbnail files:
Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force | Remove-Item –Force

8 comments
2
Facebook Twitter Google + Pinterest
previous post
MS SQL Server 2019 Installation Guide: Basic Settings and Recommendations
next post
Checking User Logon History in Active Directory Domain with PowerShell

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

8 comments

John August 15, 2022 - 6:59 pm

You Are A Star !!!! Been bugging me for years and years !

Reply
Frank O October 22, 2022 - 12:58 am

Thanks!

Reply
BuzzedDarkYear November 28, 2022 - 3:32 pm

How would you run this in a script? Another words how would you change the target first then run the PS script on that target?

Reply
seb December 13, 2022 - 8:05 am

Interesting but last step don’t work on network folders, simply because server is always using those folders, so any files can’t be deleted.

Reply
J January 5, 2023 - 5:50 pm

More articles with mis-information due to sloppy writing.

Reply
J January 5, 2023 - 5:51 pm

https://gpsearch.azurewebsites.net/#4761

Reply
serg January 9, 2023 - 3:39 am

Turn off the caching of thumbnails in hidden thumbs.db files (HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer\DisableThumbsDBOnNetworkFolders)
and
Turn off the display of thumbnails and only display icons on network folders (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisableThumbnailsOnNetworkFolders)

Reply
Ted Ford April 5, 2023 - 1:29 am

WIN10 Home does not have a group policy editor, so this answer is not relevant to many users.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Updating List of Trusted Root Certificates in Windows
  • Configure Google Chrome Settings with Group Policy
  • How to Find the Source of Account Lockouts in Active Directory
  • How to Hide or Show User Accounts from Login Screen on Windows 10/11?
  • How to Disable or Enable USB Drives in Windows using Group Policy
  • Configuring Proxy Settings on Windows Using Group Policy Preferences
  • Changing Default File Associations in Windows 10 and 11
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top