2012年7月9日 星期一

Win7家用版下使用圖片、影片的預覽,但取消快取Thumbs.db的方法

使用 Windows 7 以來,最不滿意的部分,
除了無法使用FolderSize (微軟移除API)以外(目前想看資料夾大小暫以ExplorerXP 充數),
而且,微軟似乎沒打算處理,真的很糟!

我想要看到圖片、影片的預覽圖,但是又不想要它幫我建立thumbs.db 這個占空間礙眼快取,更重要的是還時常會(尤其是有pdf 檔時)鎖住,害我不能刪除或改名該資料夾!
Thumbs.db 鎖住的問題,似乎只出現在小圖示、清單、詳細清單這三種檢視狀態,改成別的檢視方式幾乎都沒有鎖住問題。
以前在Windows XP 可以很簡單到資料夾選項取消快取,在Windows 7 比較麻煩,要用到gpedit.msc 群組原則編輯器去改,偏偏家用進階版沒有!!

在網上搜尋後,找到有人介紹可去微軟下載local 群組設定說明(Group Policy Settings Reference for Windows and Windows Server),然後手動用regedit去改登錄檔。
下載windows 7 版文件,在Excel 檔內搜尋thumbs.db,找到關閉縮圖快取這個設定是在Thumbnails.admx 這個檔,且說明reg位置在[HKCU\Software\Policies\Microsoft\Windows\Explorer!DisableThumbsDBOnNetworkFolders]。
說明內容是:
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.
然後我就卡住了,不確定怎樣來弄這個reg設定。

我接下在微軟網站下載 [Administrative Templates (ADMX) for Windows Server 2008 R2 and Windows 7] 並安裝,實際找到Thumbnails.admx 這個檔並開啟來看,發現他的相關policy是:

    <policy name="DisableThumbsDBOnNetworkFolders" class="User" displayName="$(string.DisableThumbsDBOnNetworkFolders)" explainText="$(string.DisableThumbsDBOnNetworkFolders_Help)" key="Software\Policies\Microsoft\Windows\Explorer" valueName="DisableThumbsDBOnNetworkFolders">
      <parentCategory ref="windows:WindowsExplorer" />
      <supportedOn ref="products:MicrosoftWindowsVista_SP1" />
      <enabledValue>
        <decimal value="1" />
      </enabledValue>
      <disabledValue>
        <decimal value="0" />
      </disabledValue>
    </policy>

原來之前設定說明裡的驚嘆號是要加個值啊~
最後我在[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows],新增一個叫做"Explorer"的機碼,然後在它裡面新增名為"DisableThumbsDBOnNetworkFolders"的DWORD,數值設1(確認要關閉)。
弄好重新開機後,應該就可以了。

Windows 家用Home版沒有gpedit.msc真麻煩,以後有需要,直接下載設定說明、或ADMX來參考修改reg 吧!。


註:
設定好以後,原來生成的一大堆Thumbs.db,就一次用批次檔全刪掉吧!
在桌面上按右鍵新增文字文件後,改名為DelThumbs.bat。
批次檔寫法:
========以下複製進DelThumbs.bat後存檔執行========
d:
cd\
attrib -s -h -r Thumbs.db /s /d
del Thumbs.db /s

========以上複製進DelThumbs.bat後存檔執行========

此篇到此。

沒有留言:

張貼留言