Apologies for the geeky article, but it solves a problem experienced by many web developers who use Windows as their primary OS. Thumbs.db is an image cache which makes thumbnail viewing faster. The file is automatically created in Windows Vista, 7 and 8 whenever images are encountered in a folder. It’s usually hidden but can appear, disappear and is often impossible to delete.

I understand the point of Thumbs.db, but that doesn’t prevent several irritations:

  • It affects version control. If you’re using a system such as TortoiseGit or TortoiseSVN, Thumbs.db will cause “changed” icon overlays to appear when you’ve not modified any files.
  • They often get uploaded to live servers where they’re pointless.
  • Unless you’ve got a slow PC, you probably won’t notice any speed improvement.
  • I don’t want auto-generated files cluttering my system, thank you!

Fortunately, there’s an easy way to prevent further Thumbs.db hassle:

  1. Ensure you’re logged in using an administrator account.
  2. Hit Win+R, type gpedit.msc in the Run window and click OK. The Local Group Policy Editor will be launched.
  3. Navigate through the tree to User Configuration > Administrative Templates > Windows Components > then either Windows Explorer (Windows Vista/7) or File Explorer (Windows 8).

    Local Group Policy Editor

  4. In the right-hand pane, double-click “Turn off the caching of thumbnails in hidden thumbs.db files”.
  5. Select Enabled (don’t make my mistake of choosing “Disabled” — you’re enabling the switching off of Thumbs.db. Not particularly intuitive, Microsoft!)

    Local Group Policy Editor

OK your way out and it’s job done — you’ll never be troubled by Thumbs.db files ever again!

Comments on this article are closed. Have a question about Windows and Servers? Why not ask it on our forums?

Tags: images, thumbs.db, windows
Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler

  • Torrance Scott

    Nice! I might go ahead and look at some of the other options I didn’t know existed. Thanks!

  • http://www.bluemwhitew.com Matt Walters

    You could just add a rule in your “.gitignore” if you’re worried about it screwing with version-controlled directories, surely? As much as I hate the idea of cache files lurking in the shadows of every folder containing images, I do prefer having them enabled as it considerably speeds up viewing thumbnails of DSLR photos on my NAS (or other networked devices), especially when the images are over 10MB each!

  • http://www.netcentrics.co.uk Pete Wright

    Nice, thanks Craig – it may be a relatively minor niggle, but it’s a persistent one.

  • mike ritter

    My Windows machine was all buggered up until I did this a few months back.

  • Les

    Well, my Windows says the file cannot be found? No shock there, half the …. time this Windows OS doesn’t work :(

  • David

    I have Windows 7 Home Premium, and the result I get when running gpedit is “MMC could not create the snap-in”.

    What’s the relevant entry in the registry so I can change it using regedit instead?

    • http://www.optimalworks.net/ Craig Buckler

      set DisableThumbnailCache to 1.

      Please be careful in there!

  • http://www.trivial.ly Nicholas Johnson

    Yes, if you’re using git, just add the line: thumbs.db to your .gitignore file. On OSX you need: *.DS_Store instead.

  • Richard

    So you chose “Disable” even though there was a helpful Help: panel there in front of you which explained this really not very confusing feature?
    Don’t think as a Techno GeekAdviser that I would have mentioned that.
    What is that acronym, RTFM??

    • http://www.optimalworks.net/ Craig Buckler

      So I should claim that I never make mistakes? I don’t care how much information is provided — clicking “Enable” to disable thumbs.db is not particularly obvious and it’s important to highlight it. I made the mistake and others will too.

  • Shane Goodman

    The “Local Group Policy Editor” isn’t installed. I think this article only applies to those people whose machines are connected to a domain (at work).

    • http://www.optimalworks.net/ Craig Buckler

      I don’t think that’s the case – I’m using from a standard PC on a home network. Are you using a Home or Basic edition of Windows? See the registry alternative in the comments below…

  • http://www.xoogu.com/ Dave

    Strangely my Win7 doesn’t create .thumbsdb files (I always have show hidden files on so it would be easy to see if it did). The only time I find them is in old folders or zips emailed to me. I do use QT tab bar, so maybe that overrides the default thumbnail creation process.

    I have followed your instructions and enabled the disabling anyway just in case (before it was set at Not Configured).

    • http://www.optimalworks.net/ Craig Buckler

      I enable viewing of hidden files, but often spot Windows 8 creating thumbs.db then removing it (although whether it actually goes is another matter).

  • Ray Rios

    I started noticing this file infiltrating my folders as I got further into web development. Usually on top of my file system as is, but when you start holding your folders accountable for their file size/ amount, little things like this start to grate on your sanity. thank you kind sir.

Special Offer
Free course!

Git into it! Bonus course Introduction to Git is yours when you take up a free 14 day SitePoint Premium trial.