Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

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

December 17, 2024 Group PoliciesWindows 10Windows 11Windows Server 2022

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

Thumbs.db (thumbnail cache) is a hidden system file that is automatically created by the Windows File Explorer in folders containing image and video files when the thumbnail preview mode is used. Explorer creates thumbnails of the images in a directory and stores them in the thumbs.db file.

However, the thumbs.db file can cause users a number of problems when it is generated for a shared folder that contains images. In this article, we will look at how to remove the thumbs.db file and how to disable its creation in Windows.

Contents:
  • What are Thumbs.db files for on Windows?
  • Unable to Delete Network Folder Because Thumbs.db is in Use
  • Disable Thumbs.db Creation on Shared Network Folders
  • Removing Thumbs.db Files with PowerShell

What are Thumbs.db files for on Windows?

Windows File Explorer saves information about thumbnails (small image previews) of jpeg, bmp, gif, tif, pdf, html files and some videofiles to the thumbs.db file. By storing the thumbnail cache in the thumbs.db file, Windows Explorer does not need to generate and recalculate thumbnails of images each time a user views a directory. This reduces the time it takes to load and display image thumbnails in Explorer.

The size of the thumbs.db file depends on the number of image files in the directory.

By default, thumbs.db file is hidden and not displayed in File Explorer. To show it, uncheck the Hide protected operating system files option in the Explorer settings.

show hidden thumbs.db file in shared folder

The thumbs.db file is only created for network folders in modern versions of Windows. The thumbs.db file is not created for local image folders 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

You can reset the thumbnail cache if your Windows isn’t displaying icons or thumbnails correctly.

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.

Common problems with the thumbs.db file :

  • Security: it is possible to extract thumbnails of all images in the folder (even deleted ones) from the thumbs.db file.
  • After accessing a shared folder in thumbnail view mode, users cannot move or delete it because of the thumbs.db file is being used (locked) by Explorer.
  • If you manually delete the thumbs.db file, it will be automatically re-created when another user views image thumbnails in the share.

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

A common problem with the thumbnail caching feature occurs when used with shared network folders. For example, immediately after copying/moving an image directory to a shared folder, Windows does not allow you to delete or rename the directory. Usually, you will have to wait some time (1-5 minutes) before you can rename/delete such a directory.

The following error occurred when you tried to delete or move this share

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

This problem is described in the Microsoft Knowledge Base article KB2025703 (Renaming a network folder in Windows Explorer fails with “the action can’t be completed). The article states that the presence of thumbs.db file with a thumbnail cache can sometimes prevent network folders from being deleted or renamed.

While this file is being created or updated, the user cannot do anything with its parent directory until thumbcache.dll releases the lock on thumbs.db file.

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

Disable Thumbs.db Creation on Shared Network Folders

You can safely manually delete the thumbs.db file. However, the next time a user views the thumbnails of the files in that folder, it will automatically be recreated.

To prevent Windows Explorer from displaying thumbnails of images in folders and to prevent thumbs.db file from being created:

  1. Open the Folder Options in File Explorer
  2. Go to the View tab
  3. Enable the “Always show icons, never thumbnails” option in Advanced Settings.

Disable thumbnails creation in folder via File Explorer

However, this setting also prevents thumbnails from being displayed in local folders. This can be inconvenient.

To prevent File Explorer from creating a hidden thumbnail cache (Thumbs.db) when browsing shared folders, use Group Policies.

    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 creation of the thumbs.db file by File Explorer: Turn off the display of thumbnails and only display icons on network folders (prevents creation of thumbs.db file in network folders)
    4.   The following two options disable thumbnail creation for local folders as well: Turn off caching of thumbnails in hidden thumbs.db files and Turn off the display of thumbnails and only display iconsgroup policy - turn off thumbnails caching on network folders
    5. Enable at least the first policy by changing its value to Enabled
    6. Wait for the GPO settings to be updated on the users’ computers. To apply the policy settings immediately, run the command: gpupdate /force

On Windows Home editions (which don’t have the local GPO editor), you can use the registry to disable the creation of hidden thumbs.db files on network shares.

To do this, create a new registry key Explorer under the HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\, and add 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

Removing Thumbs.db Files with PowerShell

Existing Thumbs.db files in shared network folders are not automatically deleted after the policy is enabled or the registry key is created. You can use PowerShell to recursively remove all of the Thumbs.db files from a shared network folder.

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

cd '\\mun-fs01\Public\Photo'
List all Thumbs.db files in subfolders:
Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force
delete thumbs.db files from network drive using powershell

Recursively delete the image thumbnail files found in all nested folders:

Get-ChildItem -Path . -Include Thumbs.db -Recurse -Name -Force | Remove-Item –Force

10 comments
5
Facebook Twitter Google + Pinterest
previous post
USB Device Passthrough (Redirect) to Hyper-V Virtual Machine
next post
Check User Login History in Active Directory with PowerShell

Related Reading

Configure NTP Time Source for Active Directory Domain

May 6, 2025

How to Cancel Windows Update Pending Restart Loop

May 6, 2025

View Windows Update History with PowerShell (CMD)

April 30, 2025

Cannot Install Network Adapter Drivers on Windows Server

April 29, 2025

Change BIOS from Legacy to UEFI without Reinstalling...

April 21, 2025

10 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
z October 10, 2024 - 7:31 pm

Recursively Delete Thumbs.db on Shared Folder using PowerShell didn’t work in Windows 10 Pro 22H2.

PowerShell returns the following error: Set-Location : A positional parameter cannot be found that accepts argument ‘files’.

Reply
admin October 13, 2024 - 2:02 pm

If the target path of the CD command contains spaces or special characters, enclose the entire path in quotation marks.
cd ‘c:\Program Files’

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

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

  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025
  • How to Write Logs to the Windows Event Viewer from PowerShell/CMD

    March 3, 2025
  • How to Hide (Block) a Specific Windows Update

    February 25, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Updating List of Trusted Root Certificates in Windows
  • Configure Google Chrome Settings with Group Policy
  • Configuring FSLogix Profile Containers on Windows Server RDS
  • How to Disable or Enable USB Drives in Windows using 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
  • Changing Default File Associations in Windows 10 and 11
Footer Logo

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


Back To Top