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

ใช้งาน Unified Write Filter (UWF) บน Windows 10: ปกป้องระบบจากการเปลี่ยนแปลง

UWF (Unified Write Filter) เป็นตัวกรองการเขียนไฟล์ (Write Filter) ใน Windows 10 Enterprise/Education/LTSC ที่ปกป้องไฟล์ระบบและผู้ใช้บนดิสก์ท้องถิ่นจากการเปลี่ยนแปลงใดๆ การเขียนทั้งหมดจะถูก Redirect ไปยัง Overlay (RAM หรือ Disk) และจะหายไปเมื่อรีสตาร์ท ทำให้ระบบกลับสู่สภาพเดิมเสมอ

เปิดใช้งานและตั้งค่า UWF

  1. เปิดผ่าน Control Panel > Programs and Features > Turn Windows Features On/Off > Device Lockdown > Unified Write Filter
  2. หรือ PowerShell: Enable-WindowsOptionalFeature -Online -FeatureName "Client-UnifiedWriteFilter" -All
  3. Enable Filter: uwfmgr.exe filter enable > Restart
  4. ปกป้อง Volume: uwfmgr.exe volume protect C: > Restart

ตรวจสอบสถานะ: uwfmgr.exe get-config (Volume state: Protected)

จัดการ Overlay (พื้นที่เก็บการเปลี่ยนแปลงชั่วคราว)

  • Type: RAM (Default 1 GB) หรือ Disk
  • Maximum Size, Warning Threshold, Critical Threshold
  • ตั้งค่า: uwfmgr overlay set-size 8192 (MB), uwfmgr overlay set-warningthreshold 7168, uwfmgr overlay set-criticalthreshold 8192
  • เปลี่ยนเป็น Disk Overlay: uwfmgr overlay set-type Disk
  • ดูการใช้งาน: uwfmgr overlay get-consumption, uwfmgr overlay get-availablespace

Servicing Mode (ติดตั้ง Updates/Antivirus)

# เข้า Servicing Mode (Boot ด้วย Account UWF-Servicing อัตโนมัติ)
uwfmgr servicing enable
# Restart - ระบบจะติดตั้ง Updates จาก Windows Update/WSUS แล้ว Restart กลับมา Normal Mode

# หรือ Update โดยไม่เข้า Servicing Mode
uwfmgr servicing update-windows
# Result: REBOOT REQUIRED

Exclusions (ยกเว้นไฟล์/โฟลเดอร์/Registry ให้เขียนตรง Disk)

# ไฟล์/โฟลเดอร์
uwfmgr.exe file add-exclusion C:\Labs
uwfmgr.exe file add-exclusion C:\Labs\report.docx

# Registry
uwfmgr.exe registry add-exclusion "HKLM\Software\My_RegKey"

# ดู/ลบ Exclusions
uwfmgr file get-exclusions
uwfmgr file remove-exclusion C:\Student\report.docx

Exclusions แนะนำสำหรับบริการสำคัญ:

  • BITS: %ALLUSERSPROFILE%\Microsoft\Network\Downloader, HKLM\Software\Microsoft\Windows\CurrentVersion\BITS\StateIndex
  • Wi-Fi: HKLM\SOFTWARE\Policies\Microsoft\Windows\Wireless\GPTWirelessPolicy, C:\Windows\wlansvc\Policies, HKLM\SOFTWARE\Microsoft\wlansvc, C:\ProgramData\Microsoft\wlansvc\Profiles\...
  • Wired: HKLM\SOFTWARE\Policies\Microsoft\Windows\WiredL2\GP_Policy, C:\Windows\dot3svc\Policies, ...
  • Windows Defender: C:\Program Files\Windows Defender, C:\ProgramData\Microsoft\Windows Defender, HKLM\SOFTWARE\Microsoft\Windows Defender

HORM (Hibernate Once/Resume Many) – Windows 10 1709+

โหมดเริ่มเร็ว: ระบบ Hibernate ครั้งเดียว แล้วทุกครั้งที่บูทจะ Resume สู่สถานะนั้นทันที

uwfmgr filter enable-horm
shutdown /h
# Wake up > Restart > ระบบกลับสู่สถานะ Hibernate ทันที
uwfmgr filter disable-horm

ข้อจำกัด HORM: UWF ทุก Fixed Drives, ไม่รองรับ Exclusions, Overlay ต้องเป็น RAM, Disable Hibernation/Fast Startup

ปิด/Reset UWF

uwfmgr filter reset-settings
uwfmgr.exe filter disable
uwfmgr.exe volume unprotect E:

หากบูทไม่ได้: Boot จาก Media > Edit Registry Offline: Set Start=4 ใน HKLM\SYSTEM\ControlSet001\Services\uwfvol, ลบ uwfvol ใน LowerFilters ของ Class {71a27cdd-812a-11d0-bec7-08002be2092f}