想要滑鼠游標停留在資料夾上時,顯示專屬說明(如「專案原始碼 - 勿動」、「機密文件 - 僅限授權人員」、「備份日期 2024-01-15」)?Win7 支援透過資料夾根目錄下的 desktop.ini 設定 InfoTip 實現自訂工具提示,無需第三方軟體、不影響資料夾功能、跨裝置複製資料夾即保留提示。本文完整教學建立步驟、進階屬性與部署腳本。
desktop.ini(需顯示副檔名,關閉「隱藏已知檔案類型副檔名」)。desktop.ini,貼入以下內容:[.ShellClassInfo]
InfoTip=您的自訂說明文字
; 範例:
; InfoTip=專案原始碼 - 勿動 - 最後更新 2024-01-15
; InfoTip=機密等級:絕密 - 僅限核心團隊存取
; InfoTip=備份來源:Server01:/data/backup - 保留期 90 天
desktop.ini 設為系統檔案 + 隱藏(關鍵步驟,否則資料夾圖示可能不更新、檔案顯眼):管理員 CMD 在資料夾路徑下執行:
attrib +s +h desktop.ini
; +s = 系統檔案,+h = 隱藏
; 資料夾本身也需設為系統屬性才能生效圖示/提示變更:
attrib +s "資料夾完整路徑"
explorer.exe。InfoTip 顯示。| 屬性 | 功能 | 範例 |
|---|---|---|
| InfoTip | 滑鼠游標停留工具提示 | InfoTip=這是重要資料夾 |
| IconResource | 自訂資料夾圖示 | IconResource=C:\Windows\System32\shell32.dll,45 |
| IconFile | 圖示檔案路徑 (舊版) | IconFile=C:\Icons\myfolder.ico |
| IconIndex | 圖示索引 (搭配 IconFile) | IconIndex=0 |
| ConfirmFileOp | 移動/刪除資料夾時確認 | ConfirmFileOp=1 |
| NoSharing | 禁止共用此資料夾 | NoSharing=1 |
$folders = @(
@{Path="D:\Projects\ProjectA"; Tip="專案 A 原始碼 - 核心模組 - 勿動"}
@{Path="D:\Projects\ProjectB"; Tip="專案 B 文件 - 設計稿 - 僅供參考"}
@{Path="D:\Backup\2024-Q1"; Tip="2024 Q1 完整備份 - 保留至 2025-03-31"}
)
foreach ($f in $folders) {
$ini = Join-Path $f.Path "desktop.ini"
@"
[.ShellClassInfo]
InfoTip=$($f.Tip)
"@ | Set-Content -Path $ini -Encoding UTF8
attrib +s +h $ini
attrib +s $f.Path
Write-Host "Applied to $($f.Path)"
}
desktop.ini 及資料夾 +s 屬性(xcopy /s /h /k 或 robocopy /copyall)。管理員 CMD 在資料夾下:
attrib -s -h desktop.ini
del desktop.ini
attrib -s "資料夾完整路徑"
; 重啟 explorer.exe 生效
desktop.ini + InfoTip 是 Win7 原生、零成本、可攜式的資料夾註釋機制。善用它為專案資料夾、備份目錄、共用資料夾貼上「隱形標籤」,讓團隊協作、個人歸檔、長期存檔都能一眼辨識用途與限制,資訊管理效率立竿見影提升。