使用整合寫入篩選器 (UWF) 功能Use the Unified Write Filter (UWF) feature

(UWF) 的整合寫入篩選器是一種 Windows 10 選用功能。The Unified Write Filter (UWF) is an Windows 10 optional feature.

若要使用 UWF,您必須先安裝該功能。To use UWF, you'll first need to install the feature.

接下來,您將啟用 (,並選擇性地設定) 功能。Next, you'll enable (and optionally configure) the feature. 當您第一次在裝置上啟用 UWF 時,UWF 會對您的系統進行下列變更,以改善 UWF 的效能:The first time you enable UWF on your device, UWF makes the following changes to your system to improve the performance of UWF:

  • 分頁檔案已停用。Paging files are disabled.
  • 系統還原已停用。System restore is disabled.
  • SuperFetch 已停用。SuperFetch is disabled.
  • 檔案索引服務已關閉。File indexing service is turned off.
  • 已停用快速開機。Fast boot is disabled.
  • 磁碟重組服務已關閉。Defragmentation service is turned off.
  • BCD 設定 bootstatuspolicy 設定為 ignoreallfailuresBCD setting bootstatuspolicy is set to ignoreallfailures.

啟用 UWF 之後,您最後可以選取要保護的磁片磁碟機,並開始使用 UWF。After UWF is enabled, you can finally select a drive to protect and start using UWF.

您可以安裝 UWF 來執行電腦和裝置、為自訂的 Windows 映像準備,或從遠端使用 CSP 或 WMI 進行管理。You can install UWF for running PCs and devices, prepare it for customized Windows images, or manage it remotely using CSP or WMI.

在正在執行的電腦上開啟 UWFTurn on UWF on a running PC

  1. 安裝功能:Install the feature:

    1. 按一下 [開始],輸入 開啟或關閉 Windows 功能Click Start, type Turn Windows features on or off.

    2. 在 [ Windows 功能 ] 視窗中,展開 [ 裝置鎖定 ] 節點,然後選取 [ 整合寫入篩選器 > ]In the Windows Features window, expand the Device Lockdown node, and check Unified Write Filter > OK.

      [ Windows 功能 ] 視窗表示 windows 正在搜尋必要的檔案,並顯示進度列。The Windows Features window indicates Windows is searching for required files and displays a progress bar. 找到後,視窗會指出 Windows 正在套用變更。Once found, the window indicates Windows is applying the changes. 完成時,視窗會指出所要求的變更已完成。When completed, the window indicates the requested changes are completed.

    3. 按一下 [ 關閉 ] 以關閉 [ Windows 功能 ] 視窗。Click Close to close the Windows Features window.

  2. 啟用篩選準則:Enable the filter:

    uwfmgr filter enable
    

    注意

    執行此命令之後,請重新開機電腦並結束服務模式,並停用下列專案:After you run this command, restart the computer and exit the servicing mode, the following things are disabled:

    • 藉由設定 HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate.) 來 Windows Update (Windows Update (by setting HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\NoAutoUpdate.)
    • 設定 HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore\AutoDownload.) 的 Windows Store 更新 (Windows Store Update (by setting HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore\AutoDownload.)
    • 登錄藉由設定 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Configuration Manager\RegistryReorganizationLimitDays.) 重組 (Registry Reorganization (by setting HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Configuration Manager\RegistryReorganizationLimitDays.)
    • 設定 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance\MaintenanceDisabled.) 來 (維護時數Maintenance Hour (by setting HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance\MaintenanceDisabled.)

    執行之後 uwfmgr filter disable ,請重新開機電腦並進入服務模式,變更將會還原。After you run uwfmgr filter disable, restart the computer and enter the serving mode, the changes will be reverted.

  3. 啟用磁片磁碟機的寫入保護:Enable write protection for a drive:

    uwfmgr.exe volume protect C:
    
  4. 重新啟動您的電腦。Restart your computer.

  5. 確認 UWF 正在執行:Confirm that UWF is running:

    uwfmgr.exe get-config
    

在自訂的 Windows 映像上安裝 UWFInstall UWF on a customized Windows image

  1. 以系統管理員權限開啟命令提示字元。Open a command prompt with administrator privileges.

  2. 將安裝 .wim 複製到硬碟上的暫存資料夾 (在下列步驟中,我們會假設它稱為 C: \ wim) 。Copy install.wim to a temporary folder on hard drive (in the following steps, we'll assume it's called C:\wim).

  3. 建立新的目錄。Create a new directory.

    md c:\wim
    
  4. 掛接映像。Mount the image.

    dism /mount-wim /wimfile:c:\bootmedia\sources\install.wim /index:1 /MountDir:c:\wim
    
  5. 啟用此功能。Enable the feature.

    dism /image:c:\wim /enable-feature /featureName:Client-UnifiedWriteFilter
    
  6. 認可變更。Commit the change.

    dism /unmount-wim /MountDir:c:\wim /Commit
    

若要啟用 UWF,您可以使用命令列腳本、CSP 或 WMI:To activate UWF, you can use a command-line script, CSP, or WMI:

  • CMDuwfmgr filter enable ,then uwfmgr.exe volume protect C:CMD: uwfmgr filter enable, then uwfmgr.exe volume protect C:
  • CSPCurrentSession/FilterEnabled ,then CurrentSession/VolumeCSP: CurrentSession/FilterEnabled, then CurrentSession/Volume
  • WMIUWF\Filter.Enable ,then UWF\VolumeWMI: UWF\Filter.Enable, then UWF\Volume.

使用 Windows 設定設計工具安裝 UWF 功能Install the UWF feature by using Windows Configuration Designer

  1. 遵循 建立布建套件中的指示,在 Windows 設定設計工具中建立布建套件。Create a provisioning package in Windows Configuration Designer by following the instructions in Create a provisioning package.

    注意

    在 Windows 設定設計工具中設定排除的檔案時,您不需要指定磁碟機號,因為已經透過磁片區保護設定輸入。When setting the file exclusion in Windows Configuration Designer, you do not need to specify the drive letter since that is already input via the Volume protection setting. 例如,如果要排除的檔案是在磁片區 C:\testdir\test.txt 保護中新增磁片磁碟機之後,您只需要輸入 \testdir\test.txt 以新增此檔案排除。For example, if the file being excluded is C:\testdir\test.txt, after adding a drive in Volume protection, you only need to input \testdir\test.txt to add this file exclusion.

  2. 在 [可用的自訂] 頁面中,選取 [ 執行時間設定 > SMISettings ],然後設定 [統一寫入篩選器] 設定的值。In the Available customizations page, select Runtime settings > SMISettings and then set the value for the Unified Write Filter setting.

  3. 完成設定和建立布建套件之後,您可以將套件套用至映射部署時間或執行時間。Once you have finished configuring the settings and building the provisioning package, you can apply the package to the image deployment time or runtime. 如需詳細資訊,請參閱套用布建 套件See Apply a provisioning package for more information.

若要啟用 UWF,您可以使用命令列腳本、CSP 或 WMI:To activate UWF, you can use a command-line script, CSP, or WMI:

  • CMDuwfmgr filter enable ,then uwfmgr.exe volume protect C:CMD: uwfmgr filter enable, then uwfmgr.exe volume protect C:
  • CSPCurrentSession/FilterEnabled ,then CurrentSession/VolumeCSP: CurrentSession/FilterEnabled, then CurrentSession/Volume
  • WMIUWF\Filter.Enable ,then UWF\VolumeWMI: UWF\Filter.Enable, then UWF\Volume.

使用 Windows Management Instrumentation (WMI 安裝 UWF 功能) Install the UWF feature by using Windows Management Instrumentation (WMI)

如果已安裝 Windows,而且您不想要使用布建套件,您也可以使用 Windows Management Instrumentation (WMI) 提供者來設定 UWF。If Windows has already been installed and you do not want to use a provisioning package, you can also configure UWF by using the Windows Management Instrumentation (WMI) providers. 若要使用 WMI 開啟 UWF,您可以使用 uwf _ 篩選 函式(特別是 uwf _ 篩選器 )來啟用方法。To turn on UWF using WMI, you can use the UWF_Filter function, specifically the UWF_Filter.Enable method. 您可以透過下列其中一種方式來執行此動作:You can do this in one of the following ways:

  • 在 PowerShell 腳本中直接使用 WMI 提供者。Use the WMI providers directly in a PowerShell script.
  • 直接在應用程式中使用 WMI 提供者。Use the WMI providers directly in an application.
  • 使用命令列工具( uwfmgr.exe)。Use the command line tool, uwfmgr.exe.

當您開啟或關閉 UWF 之後,變更才會生效,您必須重新開機裝置。You must restart your device after you turn on or turn off UWF before the change takes effect.

如果您想要的話,可以在開啟 UWF 之後變更這些設定。You can change these settings after you turn on UWF if you want to. 例如,您可以將分頁檔案位置移至未受保護的磁片區,並重新啟用分頁檔。For example, you can move the page file location to an unprotected volume and re-enable paging files.

重要

如果您在 unattend.xml 檔案中使用 SMI-S 設定將 UWF 新增至映射,則開啟 UWF 只會設定 bootstatuspolicy BCD 設定並關閉磁碟重組服務。If you add UWF to your image by using SMI settings in an unattend.xml file, turning on UWF only sets the bootstatuspolicy BCD setting and turns off the defragmentation service. 在此情況下,如果您想要提高 UWF 的效能,則必須手動關閉其他功能和服務。In this case, you must manually turn off the other features and services if you want to increase the performance of UWF.

所有的 UWF 設定都儲存在登錄中。All configuration settings for UWF are stored in the registry. UWF 會自動從篩選排除這些登錄專案。UWF automatically excludes these registry entries from filtering.

UWF 會在裝置重新開機後,針對目前的會話和下一個會話維護登錄中的設定。UWF maintains configuration settings in the registry for the current session and for the next session after a device restart. 靜態設定變更在裝置重新開機後才會生效,而這些變更會儲存在下一個會話的登錄專案中。Static configuration changes do not take effect until after a device restart, and these changes are saved in the registry entries for the next session. 動態設定變更會立即發生,而且會在裝置重新開機後保存。Dynamic configuration changes occur immediately and persist after a device restart.

統一寫入篩選器Unified Write Filter

整合寫入篩選器 WMI 提供者參考資料Unified Write Filter WMI provider reference

UWF 命令列工具: uwfmgr.exeUWF Command-line tool: uwfmgr.exe