1.新建一個文件夾temp,進入此文件夾,建立desktop.ini文件,編輯內容為:
; 文件夾圖標 [.ShellClassInfo] ;設置文件夾的備注 InfoTip=this is temp file ;局限性資源名稱,會修改文件的顯示名稱,但是原始的文件名不變 LocalizedResourceName=MyTempFilePRo ;設置icon的順序 IconIndex=mainicon ;設置icon位置 IconFile=%userprofile%\Desktop\bitbug_favicon.ico ; 文件夾背景 [ExtShellFolderViews] [{BE098140-A513-11D0-A3A4-00C04FD706EC}] ;定義圖片背景 IconArea_Image=%userprofile%\Desktop\temp.jpg ;定義文字的顏色 IconArea_Text=0x000000FF ;標示文件夾所有者 [DeleteOnCopy] Owner=Temp ;備注 PersonalizedName=My Temp file [ViewState] Mode= Vid= FolderType=Generic
2.隱藏desktop.ini文件
attrib +h temp/desktop.ini
3.刷新文件夾,並設置為系統類型
attrib +s temp
此時會自動刷新
參考文檔:https://baike.baidu.com/item/desktop.ini