Tuesday, June 24, 2014

Deleting blocked caused by thumb.db on Windows 2008 as a file server

Would you consider completely disabling thumbnail generation a valid option? That would certainly work. Though it comes at the cost of some usability.
Group policy User User \ Administrative Templates \ Windows Components \ Windows Explorer
Turns off the caching of thumbnails in hidden thumbs.db files.
This policy setting allows you to configure Windows Explorer to cache thumbnails of items residing in network folders in hidden thumbs.db files.
If you enable this policy setting, Windows Explorer does not create, read from, or write to thumbs.db files. If you disable or do not configure this policy setting, Windows Explorer creates, reads from, and writes to thumbs.db files.

------------------------------------------------------------------------------------------------------------

Here are my own detailed instructions, written against Windows 7 but likely the same for Vista:
  1. Run "**gpedit.msc**" directly using the Start menu. (You may also be able to find an "**Edit group policy**" control panel searching by name, but I couldn't find its icon listed anywhere under "All Control Panel Items". Go figure!)
  2. In the left-hand pane, expand User Configuration, then Administrative Templates, then Windows Components.
  3. Under Windows Components what was just expanded, select Windows Explorer.
  4. In the right-hand pane, sort by Setting, then scroll down and find the setting named "**Turn off the caching of thumbnails in hidden thumbs.db files**". Double-click it, set it to Enabled, and then clickApply.
  5. Log off Windows, and then log back on again.
Within Windows Explorer, you should now be able to delete the Thumbs.db files that you come across on the network (as long as another machine isn't currently locking the file), and the computer shouldn't create them again.
Also worth knowing: In Vista and Windows 7, Thumbs.db applies to network folders only. For local folders, Vista and Windows 7 instead save thumbnail cache information to a database in a local folder at "**%userprofile%\AppData\Local\Microsoft\Windows\Explorer**"

UPDATE: I just had to do this on another machine and was irritated by the steps, so I did a before/after comparison of a complete registry export. So, the registry equivalent for disabling Thumbs.db creation on network shares in Windows Vista and Windows 7 is:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer]
"DisableThumbsDBOnNetworkFolders"=dword:00000001 
If you place that content in its own text file (e.g. with Notepad) with a .REG extension, you can double-click to import on any Windows Vista or Windows 7 machine to apply the setting. Be careful editing your registry directly.

------------------------------------------------------------------------------------------------------------

Thumbs.db is a hidden file, so the easiest way to not see it as litter would be to simply tell Windows to not show hidden files. Of course if you use the command line a lot or have other hidden files you need to see then this won't help.
I found an article that mentions the ability to disable thumbnail caching by modifying a registry key. If the option to disable thumbnail caching is missing in Vista / Windows 7 then maybe you can still do it that way.
  1. Open the Registry Editor (regedit.exe).
  2. Navigate to the following registry branch:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Explorer\Advanced\
  3. On the right pane, double click on DisableThumbnailCache value, and set its value data as 1. If the registry key of DisableThumbnailCache does not exists, create a new DWORD value with that name.
  4. Exit Registry Editor.
  5. Logoff and login again, or restart the computer for the changes to take effect.
Another option may be to simply turn off the display of thumbnail previews in Windows Explorer:
  1. Click on the Start button, then on All Programs, follow by Accessories.
  2. Run Windows Explorer.
  3. In Windows Explorer window, click on Organize button on the menu/shortcut bar.
  4. In the pull down menu, click on Folder and Search Options.
  5. Folder Options dialog window will appear. Click on View tab.
  6. Under the Files and Folders tree heading, check (tick) the checkbox next to Always show icons, never thumbnails option.
  7. Click the OK button.
----------------------------------------------------------------------------------------------------------------------------------


No comments: