REAgentC 命令列選項

您可以使用REAgentC.exe工具來設定 Windows 復原環境 (Windows RE) 開機映射和按鈕重設修復映射,以及管理復原選項和自訂。 REAgentC 隨附于 Windows,您可以在離線 Windows 映像或執行中的 Windows 作業系統上執行 REAgentC 命令。

注意

如果您使用 Windows PE 2.X、3.X 或 4.X 在離線安裝上設定復原,則必須使用 Windows 評定與部署套件的 [復原] 資料夾中的 Winrecfg.exe 檔案, (Windows ADK) 。 Winrecfg.exe僅支援REAgentC.exe支援的離線作業。

REAgentC 語法

reagentc.exe <command> <arguments>

/setreimage

設定開機映射Windows RE的位置。

支援線上和離線作業。

/setreimage 語法

/setreimage /path <path_to_Windows_RE_image> [/target <path_to_offline_image>]

/setreimage 使用量

  • /path 支援本機磁片上位置的 UNC 路徑。 例如:

    Reagentc /setreimage /path S:\Recovery\WindowsRE`
    
  • /target 指定當您離線套用設定時,Windows 映像的位置。 例如:

    Reagentc /setreimage /path T:\Recovery\WindowsRE /target W:\Windows
    

/使

啟用自訂Windows RE開機映射。

選項 /enable 會在特製化組態階段自動執行。 如果您未指定Windows RE開機映射,電腦會嘗試使用資料夾中的預設 Winre.wim 檔案 \Windows\System32\Recovery 來啟用 Windows RE。

支援線上和離線作業。

/enable 語法

/enable [/auditmode] [/osguid <bcd_guid>]

/enable usage

  • /auditmode:根據預設,當 Windows 處於稽核模式時, /enable 此選項不會執行任何動作。 若要覆寫預設行為,並從稽核模式啟用Windows RE,請指定 /auditmode 選項。 例如:

    Reagentc /enable /auditmode
    

    如果您在稽核模式中使用 /enable 選項之後將映射一般化,Windows RE會停用,直到您再次使用 /enable 選項,或在特製化組態階段執行之後為止。

  • /osguid {<bcd_guid>}可讓您從 Windows PE 啟用自訂Windows RE開機映射。 它只能在執行bcdboot.exe之後使用。 <bcd_guid> 是透過執行 bcdedit -enum -v 取得之目標 Windows 安裝的開機組態資料 (BCD) 識別碼。

    Reagentc /enable /osguid {00000000-0000-0000-0000-000000000000}
    

/禁用

停用任何對應至線上映射的作用中Windows RE映射。

僅支援線上作業。

/disable 使用量

Reagentc /disable

/boottore

指定下次系統啟動時,Windows RE自動啟動。

僅支援線上作業。

/boottore 使用量

Reagentc /boottore

/setosimage

此設定不會用於Windows 10或更新版本

在線上或離線映射中註冊按鈕重設映射的位置。 復原映射必須是 Windows 映像 (.wim) 格式。

支援線上和離線作業。

/setosimage 語法

/setosimage /path <path_to_recovery_image> /index <image_index> [/target <path_to_offline_image>]

/setosimage 使用量

  • /index選項會指定要從 .wim 檔案中使用的復原映射索引編號。 例如:

    Reagentc /setosimage /path R:\RecoveryImage /index 1
    
  • /target選項會指定離線 Windows 映像的位置。 例如:

    Reagentc /setosimage /path R:\RecoveryImage /index 1 /target W:\Windows
    

/資訊

顯示線上或離線映射上Windows RE和任何可用復原映射的目前狀態。

支援線上和離線作業。

/info 語法

/info [/target <path_to_offline_image>]

/info 使用量

  • /info 本身會傳回線上作業系統的狀態:

    Reagentc /info
    
  • /target選項會取得有關離線映射的組態資訊。 例如:

    Reagentc /info /target W:\Windows
    

註冊出現在 Windows 進階啟動功能表中之自訂工具的連結。

支援線上和離線作業。

/setbootshelllink [/configfile <path_to_BootShellXML>] [/target <path_to_offline_image>]
  • BootShellXML 檔案是an.xml檔案,其中包含 <BootShell> 您要出現在連結中的 元素和 NameDescription 屬性。 如需詳細資訊,請參閱自訂Windows RE

    Reagentc /setbootshelllink /configfile F:\BootMenu\AddDiagnosticsToolToBootMenu.xml
    
  • /target選項會指定離線 Windows 映像的位置。 如果未使用此引數,則會使用執行中的作業系統。 例如:

    Reagentc /setbootshelllink /target W:\Windows
    

Windows RE 疑難排解功能