imagex 的使用教學介紹 – 擷取、修改及套用映像

(參考微軟教學網頁), 然整理如下:

什麼是 ImageX?

ImageX 是一套命令列工具,可讓原始設備製造商 (OEM) 與企業擷取、修改及套用以檔案為基礎的磁碟映像,以利快速部署。 ImageX 可與 Windows 映像檔案 (.wim) 搭配使用,將檔案複製到網路,也可以與使用 .wim 映像的其他技術搭配使用,例如 Windows 安裝程式、Windows 部署服務 (Windows DS) 以及 System Management Server (SMS) 作業系統功能部署套件。

ImageX 如何運作

ImageX 是從一組 API (稱為 Windows 的映像 API) 組建的映像工具。ImageX 的主要目的是擷取、修改及套用映像,以部署於製造商或公司的 IT 環境中。ImageX 支援新的 Microsoft Windows 映像 (.wim) 格式。

ImageX 結構: ImageX 會依賴數個元件,包括 ImageX 執行檔 (ImageX.exe)、WIM 檔案系統篩選器 (Wimfltr.sys 及 Wimfltr.inf)、WIM API 集,以及 .wim 檔案格式。下圖顯示這些元件之間的互動。

ImageX 命令列選項

ImageX 是 Windows Vista 的命令列工具,可用來建立及管理 Windows 映像 (.wim) 檔案。.wim 檔案包含一或多個磁碟區映像、包含已安裝之 Windows 作業系統映像的磁碟區。

若要修改磁碟區映像,您必須在執行 Windows XP Service Pack 2 (SP2)、Windows Server 2003 Service Pack 1 (SP1) 或 Windows Vista 的電腦上,安裝 Windows 映像檔案系統篩選器 (WIM FS 篩選器) 驅動程式。安裝 WIM FS 篩選器驅動程式可讓您將 .wim 檔案當成目錄一樣掛接,而且不用解壓縮或重新建立映像,就能在檔案管理工具 (例如 Windows 檔案總管) 中瀏覽、複製、貼上及編輯磁碟區映像。

mageX 命令列選項的用法如下:
imagex [flags] {/append | /apply | /capture | /delete | /dir | /export | /info | /split | /mount | /mountrw | /unmount} [parameters]

下列清單會顯示每個 imagex 作業類型所用的有效語法:

  • imagex /append image_path image_file {“description”} {/boot | /check | /configconfiguration_file.ini | /scroll | /verify}
    將磁碟區映像附加到現有的 Windows 映像 (.wim) 檔案。建立檔案的單一例項、將其與 .wim 檔案中已存在的資源相比較,讓您不致於重複擷取同一個檔案。

    • ex: imagex /append d:d:\imaging\data.wim “Drive D” /verify
  • imagex /apply image_file image_number image_name image_path {/check | /ref | /scroll | /verify}
    將磁碟區映像套用到指定的磁碟機。

    • ex: imagex /apply d:\imaging\data.wim 1 d:\New_Directory /verify
  • imagex /capture image_path image_file “name” {“description”} {/boot | /check | /compress [type] | /config | /flags “EditionID” | /norpfix | /scroll | /verify}
    將來自磁碟機的磁碟區映像擷取到新的 .wim 檔案。擷取的目錄會包含所有的子資料夾及資料。您無法擷取空的目錄。目錄必須至少包含一個檔案。

    • ex: imagex /capture d:d:\imaging\data.wim “Drive D” /verify
    • ex: imagex /compress fast /flags “Ultimate” /check /scroll /capture c:d:\install.wim “Windows Vista Ultimate”
  • imagex /delete image_file image_number image_name {/check}
    從含有多個磁碟區映像的 .wim 檔案中,刪除指定的磁碟區映像。此選項只會刪除中繼資料項目及 XML 項目。它不會刪除串流資料,也不會最佳化 .wim 檔案。

    • ex: imagex /delete d:\imaging\data.wim 1
  • imagex /dir image_file image_number image_name
    顯示指定之磁碟區映像內檔案及資料夾的清單。

    • ex: imagex /dir d:\imaging\data.wim 1
  • imagex /export src_file src_number src_name dest_file dest_name {/boot | /check | /compress [type] | /ref [splitwim.swm]}
    將指定之 .wim 檔案的複本匯出至其他的 wim. 檔案。來源及目的檔案必須使用同一個壓縮類型。您也可以匯出至新的映像檔案,將映像最佳化。當您修改映像時,ImageX 會儲存其他資源,使得映像整體大小增加。匯出映像會移除不必要的資源檔案。

    • ex: imagex /export d:\imaging\data.wim d:\imaging\sample.wim 1
  • imagex /info img_file[img_number | img_name] [new_name] [new_desc] {/boot | /check}
    傳回針對指定 .wim 檔案所儲存的 XML 描述,包括 (但不限於) 檔案大小總計、映像索引編號、目錄計數、檔案計數及描述。
    ex: imagex /info d:\imaging\data.wim
  • imagex /mount image_file image_number image_name image_path {/check}
    從 Microsoft Windows XP Service Pack 2 (SP2)、Microsoft Windows Server 2003 Service Pack 1 (SP1) 或 Windows Vista 掛接具有唯讀權限的 .wim 檔案至指定的目錄。檔案一經掛接之後,您便可檢視 (但不能修改) 目錄中包含的所有資訊。

    • ex: imagex /mount d:\imaging\data.wim 2 c:\mounted_images
  • imagex /mountrw image_file image_number image_name image_path {/check}
    從 Microsoft Windows XP Service Pack 2 (SP2)、Microsoft Windows Server 2003 Service Pack 1 (SP1) 或 Windows Vista 掛接具有讀取/寫入權限的 .wim 檔案至指定的目錄。檔案一經掛接之後,您便可檢視及修改目錄中包含的所有資訊。

    • ex: imagex /mountrw d:\imaging\data.wim 2 c:\mounted_images
  • imagex /split image_file dest_file size {/check}
    將現有的 .wim 檔案分割為多個唯讀分割 .wim 檔案 (.swm)。

    • ex: imagex /split d:\imaging\data.wim 600
  • imagex /unmount image_path {/commit}
    取消掛接指定目錄中的已掛接映像。

    • ex: imagex /unmount /commit c:\mounted_images

 

/verify 及 /check 支援 .wim 檔案的檔案驗證及資料完整性

在套用作業期間,/verify 及 /check 選項會影響效能。建議您使用 /verify 及 /check 兩個選項以獲得最佳的映像驗證及資料完整性。

  • /verify 選項: 會驗證快取寫入並檢查錯誤及檔案重複。/verify 選項不支援磁碟清除、寫出或略過系統快取。在擷取作業期間,/verify 選項會讀回擷取的檔案,並依每個位元組與原始所擷取檔案進行比較。在套用作業期間,/verify 選項會重新雜湊套用的檔案,並與在擷取作業期間所產生的雜湊進行比較。
  • /check 選項: 是專為偵測 .wim 檔案的損毀而設計。如果未在擷取作業期間設定 /check 選項,則在套用作業期間會忽略旗標。在擷取作業期間,/check 選項會對 .wim 檔案以每 10 MB 資料區塊的方式產生及儲存一系列的雜湊。在套用作業期間,/check 選項會對在擷取作業期間所儲存的雜湊進行雜湊並驗證這些 10 MB 的區塊。

ImageX 錯誤碼

  • 0 成功
  • 1 命令列選項無效
  • 2 WIMGAPI 失敗
  • 3 設定指令碼無效
  • 4 拒絕存取,需要系統管理員權限

什麼是.wim檔 ?

http://eeepage.info/windows-imaging-file-format-wim/

發表迴響