You can find out which process is blocking it with Unlocker. If you can't kill that process you can mark this file or folder to be deleted right after the next boot with MoveFileEx.
[DllImport("kernel32.dll")]
public static extern bool MoveFileEx(string lpExistingFileName, string lpNewFileName, int dwFlags);
public const int MOVEFILE_DELAY_UNTIL_REBOOT = 0x4;
//Usage:
MoveFileEx(fileName, null, MOVEFILE_DELAY_UNTIL_REBOOT);
If you want to disable the creation of "Thumbs.db"-Files completely you can switch it off in the registry. Open the registry editor, navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
and set the value of NoThumbnailCache
to 1
. If this entry doesnt exist you simply can create it (DWORD 32
).
For Win7 Professional / Ultimate the path to the entry is HKEY_CURRENT_USER\Software\Microsoft\ Windows\CurrentVersion\Explorer\Advanced
and it's name is DisableThumbnailCache
.