views:

189

answers:

4

Is there a way (via shell extension or registry setting) to tell Windows Explorer that it shouldn't read files in the folder being shown in order to extract metadata or create thumbnails?

The problem is that when the user navigates to the folder, Windows Explorer attempts to read all files in the folder and extract certain metadata from them. If the medium is slow, this takes ages and causes unnecessary load on the file system. This is especially true in case of thumbnails, when the whole graphic file is read.

I am looking for ways to do this (restrict Explorer) in code, so "don't use Thumbnail mode" is not an acceptable answer :).

Upd: per-user settings won't work unfortunately cause we as a disk provider can deal only with our own disk (and the user might want to have separate settings for regular disks and virtual disks). I believe there must be some way to "explain" the OS that the drive is slow.

Maybe there's some IRP on driver level that we need to handle to tell the OS that the medium is slow?

+1  A: 

I'm not sure if you can disable thumbnail generation/display for certain folders but this article talks about a script which could quickly disable it via context menu.

The script modifies a value in the registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\. I suppose you could find something similar in that key for the other metadata. ShowInfoTip sounds promising. There might be relevant information in other nearby keys.

Jeff M
+1  A: 

Never seen it done on a per-folder basis, but if you want to restrict thumbnails per user, or for all users you can use either registry settings or group policy: http://www.sevenforums.com/tutorials/11738-thumbnail-previews-enable-disable.html

Fred
+4  A: 

Is there a way (via shell extension or registry setting) to tell Windows Explorer that it shouldn't read files in the folder being shown in order to extract metadata or create thumbnails?

Not that I know off, but depending on the priorities regarding the use case details you outlined there might be two options still to approximate the desired result:

Via group policy

Note that this essential expands/details the network folder related aspect of Freds answer, which you dismissed in your update; however, you claim to be able to deploy shell extensions or registry settings and the following two group policies simply execute the latter by administrative means:

User Configuration -> Administrative Templates -> Windows Components ->  Windows Explorer:

Turn off the display of thumbnails and only display icons **on network folders**
Turns off the caching of thumbnails in hidden thumbs.db files.

This boils down to the following registry settings:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer]
"DisableThumbnailsOnNetworkFolders"=dword:00000001
"DisableThumbsDBOnNetworkFolders"=dword:00000001

Of course this is still not per folder, but at least limited to network folders and ignores regular disks and virtual disks.

Via hackish workaround

Given your statement we as disk provider can deal only with our own disk there might be a hackish workaround, though I'm afraid it lacks the last mile (untested by myself).

Starting from Chris W. Reas own answer to How can I suppress those annoying Thumbs.db files in Windows Vista and Windows 7?:

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"

Continuing from there, Wil claims the following potentially clever solution to work on a per folder basis:

Go to the drive and create a file called thumbs.db (in notepad or anything), then change the permissions on the file for everyone (including SYSTEM) to deny all.

Unfortunately, aside from the automation requirements to create the dummy thumbs.db in each folder, the outcome depends on how Explorer will react on the inaccessible file - because caching is optional as per group policy, it might as well display thumbnails without caching them, making the bandwidth issue even worse in turn ...

Good luck!

Steffen Opel
Thank you for the detailed comment. Although we can't use these hacks as a general solution inside the product, we will surely recommend it to our customers by directing them to your post. I've voted for it and will ask the users to do the same. I still keep the bounty, though, for maybe somebody comes with exact answer. I believe there must be something there.
Eugene Mayevski 'EldoS Corp
+1  A: 

This may be a complete non-answer depending on your needs, but how about storing the files without file extensions that the OS wants to make thumbnails of? Call it file.jpg.abc and it won't be reading thumbnails, for sure.

Emtucifor
+1 for a trick, though I think that the whole point of browsing a disk would be to do something with files (open them, copy them etc.) and possibility to do this easily depends also on file extension.
Eugene Mayevski 'EldoS Corp
Yes, if the files need to be normal and accessible from the file system then this is not an option.
Emtucifor