Can't Delete a Folder Because of Thumbs.db?
A folder won't delete, you get file in use, and the culprit is a hidden Thumbs.db that keeps coming back. Here is how to clear the lock, delete it safely, and stop Windows creating it.
Fix: a folder will not delete because of Thumbs.db
- Close the Explorer window showing that folder and any preview pane — Explorer locks Thumbs.db while generating previews.
- If it is still locked, open Task Manager → Details, find
explorer.exe, end it, then restart it from File → Run new task → explorer.exe. - On a network share, the lock is usually another machine browsing the folder; wait or disable thumbnail caching (below).
- Then delete the folder, or remove the file first: in that folder run
del /a:h Thumbs.dbfrom an elevated Command Prompt (/a:htargets the hidden file).
Stop Thumbs.db from reappearing
In File Explorer Options → View enable Always show icons, never thumbnails, or via Group Policy: User Configuration → Administrative Templates → Windows Components → File Explorer → Turn off the caching of thumbnails in hidden thumbs.db files. To keep it out of a Git repo, add Thumbs.db to .gitignore.
What Thumbs.db is
Thumbs.db is a hidden Windows file that caches thumbnail images for a folder — so photo and video previews load instantly the next time you open it.
Why it can be a nuisance
It appears on network shares and in backups, and it can lock a folder ("file in use") when you try to delete or rename the folder while Explorer is generating thumbnails.
How to disable it
In File Explorer Options → View, enable Always show icons, never thumbnails, or via Group Policy: User Configuration → Administrative Templates → Windows Components → File Explorer → Turn off the caching of thumbnails in hidden thumbs.db files.
Is it safe to delete?
Yes. Windows rebuilds it as needed; you only lose the cached previews, which regenerate.
How to handle a Thumbs.db file by OS
Windows: Thumbs.db is a hidden cache of thumbnail images for a folder. You don't open it; show hidden files to see it. To view the thumbnails inside, use a Thumbs.db viewer utility.
macOS / Linux: appears when browsing Windows folders; it has no use and can be ignored or deleted.
Common problems
Thumbs.db can lock files on network shares and block folder deletion. Disable it via Group Policy (Turn off caching of thumbnails in hidden thumbs.db files) if it's a nuisance.
FAQ
How do I delete a folder that says Thumbs.db is in use?
Close the Explorer window and preview pane (they lock the file), or restart explorer.exe from Task Manager, then delete. On a network share, disable thumbnail caching via Group Policy.
Is it safe to delete Thumbs.db?
Yes. Windows recreates it when it needs thumbnails again.
How do I stop Windows creating Thumbs.db?
Turn on 'Always show icons, never thumbnails' in File Explorer Options, or disable it via Group Policy.
Why can't I delete a folder because of Thumbs.db?
Explorer may be using it to build previews. Close the window or wait, then try again.
Other file types explained
- Recover an Unsaved File in Sublime Text After a Crash
- Recover an Unsaved File in VS Code After Closing or a Crash
- Is a .crdownload File Safe to Delete? (Unfinished Chrome Downloads)
- .swp vs .swo — What's the Difference? (Vim Swap Files)
- Is Thumbs.db a Virus? Is It Safe to Delete?
- Where Are Thumbs.db Files Stored?
- How to Safely Delete a Vim .swp Swap File
- Found a Swap File by the Name — What to Do (Vim E325)