Skip to content

Cookbook: Removing .Thumbs.db files from a directory

Mark Jordan edited this page Jan 25, 2017 · 2 revisions

Using Windows Explorer to look at a directory that contains image files will generate a cache of image thumbnails with the filename .Thumbs.db. Unfortunately, by default Windows considers it a hidden file so you won't be able see it in Windows Explorer. But, it will be visible to MIK or other command-line utilities, which can lead to some unexpected and very unwanted results. There are two commands you can run to remove these files from a directory and all its child directories.

Using WindowsPowershell, from within the top-level directory, run:

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

Using the MS-DOS command prompt, from within the top-level directory, run:

del /s /q /f /a:h Thumbs.db

Also, MIK comes with a utility script that you can use to remove .Thumbs.db files and others as well.

Cookbook table of contents

Clone this wiki locally