Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows Server

วิธี Rebuild (Reset) Icon Cache ที่เสียหายบน Windows 10

เมื่อ Icons ของแอปพลิเคชันและไฟล์ประเภทต่างๆ ถูกแสดงใน File Explorer Windows แทนที่จะเข้าถึงไฟล์ต้นฉบับที่มี Icons จะดึง Copies ของ Icon Images จากไฟล์พิเศษที่มี Icon Cache เนื่องจาก OS ไม่ต้องโหลดไฟล์ Icon ต้นฉบับ Performance และ Rendering ของ Icon Objects ใน Windows Explorer จึงได้รับการปรับปรุง

ในบางกรณี หาก Cache File เสียหาย อาจแสดง White Blank Icons ของ Shortcuts และไฟล์ใน Explorer (และบน Desktop) หรือแสดง Default Windows Icons แทน Application Icons ในกรณีนี้ แนะนำให้ Reset Windows 10 Icon Cache

Screenshot ด้านล่างแสดงว่า Windows 10 Start Menu Layout แสดง Default Folder Icons แทน Application Icons บางตัว

วิธี Rebuild (Reset) Icon Cache ที่เสียหายบน Windows 10

หมายเหตุ เมื่อ Bug แบบนี้ปรากฏ บาง User พยายาม Reinstall Problem App ซึ่งมักไม่ช่วย

Icon Cache ใน Windows Versions ต่างๆ เป็นไฟล์ DB หนึ่งหรือหลายไฟล์ที่จัดเก็บใน User Profile Folders

  • ใน Windows 7 คือ IconCache.db ใน %userprofile%\AppData\Local
  • ใน Windows 10 และ Windows 8.1 เป็นหลายไฟล์ ซึ่งชื่อขึ้นต้นด้วย iconcache_ (iconcache_16.db, iconcache_32.db, iconcache_48.db ฯลฯ ตามขนาด Icons ใน Pixels) จัดเก็บใน %userprofile%\AppData\Local\Microsoft\Windows\Explorer

อย่าสับสน Thumbnail Icon Cache Files กับ Thumbs.db Cache ซึ่งมี Cache ของ Thumbnail Images และ Videos ใน Folder

วิธี Rebuild (Reset) Icon Cache ที่เสียหายบน Windows 10

การ Refresh Icon Cache บน Windows โดยใช้ IE4uinit

ใน Windows มี Built-in Tool ie4uinit (IE Per-User Initialization Utility) ที่สามารถใช้ Reset Icon Cache Database ได้อย่างรวดเร็ว

  • บน Windows 10: ie4uinit.exe -show
  • บน Windows 7: ie4uinit.exe -ClearIconCache

คำสั่งนี้ต้อง Execute ผ่าน Win + R -> Command -> Enter

วิธี Rebuild (Reset) Icon Cache ที่เสียหายบน Windows 10

คำสั่งเหล่านี้ปลอดภัยอย่างสมบูรณ์ แต่ไม่ช่วยกู้คืนสถานะปกติของ Icon Cache ในทุกกรณี

Script สำหรับ Rebuild Icon Cache บน Windows

เพื่อ Reset Icon Cache เพียงพอที่จะ Delete DB Cache Files แต่ก่อนอื่นคุณต้อง End Process Explorer.exe เพื่อ Unlock การเข้าถึง Iconcache Files มาดูวิธี Reset Icon Cache Database โดยไม่ต้อง Reboot Windows

  1. ปิดแอปที่กำลังรันทั้งหมด;
  2. เปิด Command Prompt Window (cmd.exe หรือ powershell.exe) ในฐานะ Administrator;
  3. เริ่ม Task Manager: taskmgr.exe
  4. ในหน้าต่าง Task Manager ไปที่แท็บ Details หา Process explorer.exe และ Kill มัน (End Task); วิธี Rebuild (Reset) Icon Cache ที่เสียหายบน Windows 10
  5. คุณยังสามารถ Kill Process จาก Command Line ได้: taskkill /f /im explorer.exe
  6. จากนั้น Execute คำสั่งต่อไปนี้ตามลำดับเพื่อลบ Icon Cache ใน User Profile (ขึ้นอยู่กับ OS Version):

สำหรับ Windows 10/ 8.1 (เพียง Copy & Paste โค้ดนี้ไปที่ Command Prompt Window หรือบันทึกเป็น Text File reset_icon_windows.bat)

taskkill /f /im explorer.exe
cd /d %userprofile%\AppData\Local\Microsoft\Windows\Explorer
attrib –h iconcache_*.db
del /f IconCache*
del /f thumbcache*
cd /d %userprofile%\AppData\Local\
attrib –h IconCache.db
del /f IconCache.db
start C:\Windows\explorer.exe

วิธี Rebuild (Reset) Icon Cache ที่เสียหายบน Windows 10

ในกรณีของผม สคริปต์ลบไฟล์ iconcache_idx.db ไม่สำเร็จ (Error Access Denied) แต่ไม่ส่งผลต่อผลลัพธ์สุดท้าย Icon Cache ถูก Flushed เรียบร้อยแล้ว!

สำหรับ Windows 7:

cd /d %userprofile%\AppData\Local
del /f /a s IconCache.db
start C:\Windows\explorer.exe

คำสั่งสุดท้ายในทั้งสองกรณีจะ Restart Windows Explorer Process Explorer.exe เมื่อ Launch จะสร้าง Icon Cache Files ใหม่ (ตาม File Associations ที่ตั้งค่าไว้)