REM 設定變量便于操作
SET ROOT_PATH=D:\SOFTWARE\WINDOWS7SP2
SET BOOT_WIM=%ROOT_PATH%\boot.wim
SET INSTALL_WIM=%ROOT_PATH%\install.wim
SET MOUNT_DIR=%ROOT_PATH%\SP2
SET PATCH_DIR=%ROOT_PATH%\PATCH
REM 準備工作先清理一下,避免之前失敗留下的東西。
DISM /unmount-wim /mountdir:%MOUNT_DIR% /discard
DEL /q %MOUNT_DIR%\*
DEL /q %EXPAND_DIR%\*
PAUSE
REM 檢視資訊,目的是為了擷取index
DISM /get-wiminfo /wimfile:%INSTALL_WIM%
PAUSE
REM 無效指令。删除wim中某個映像
REM DISM /delete-image /wimfile: %INSTALL_WIM%\ /index:1
REM 無效指令。改名,表示更新了
REM imagex /info %INSTALL_WIM%\ 1 “Windows 7 Ultimate SP2 X64”
REM 加載WIN7
DISM /mount-wim /wimfile:%INSTALL_WIM% /index:4 /mountdir:%MOUNT_DIR%
PAUSE
REM {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ SP2 包。
REM 安裝更新檔檔案。不使用EXPAND方式,直接安裝。
SET PATCH_FILE=Windows6.1-KB3020369-x64.msu
DISM /image:%MOUNT_DIR% /add-package /packagepath:%PATCH_DIR%\%PATCH_FILE%
SET PATCH_FILE=Windows6.1-kb3125574-v4-x64.msu
DISM /image:%MOUNT_DIR% /add-package /packagepath:%PATCH_DIR%\%PATCH_FILE%
REM 其他更新檔,沒有必要安裝。
PAUSE
REM }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} SP2 包。
REM {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ IE11REM IE11
SET PATCH_DIR_IE11=%PATCH_DIR%\IE11
SET EXPAND_DIR=%ROOT_PATH%\TEMP
%PATCH_DIR_IE11%\IE11-Windows6.1-x64-zh-cn.exe ?/x:%EXPAND_DIR%
REM ?提前安裝這個。
DISM /image:%MOUNT_DIR% /add-package /packagepath:PATCH_DIR=%\Windows6.1-KB2670838-x64.msu
REM ?IE11
DISM /image:%MOUNT_DIR% /add-package /packagepath:%EXPAND_DIR%\IE-Win7.CAB
REM ?環境元件?
DISM /image:%MOUNT_DIR% /add-package /packagepath:%EXPAND_DIR%\IE-Hyphenation-en.MSU
REM ?語言包。提示不适用?
DISM /image:%MOUNT_DIR% /add-package /packagepath:%EXPAND_DIR%\ielangpack-zh-CN.CAB
REM ?提示出錯。
REM ?DISM /image:%MOUNT_DIR% /add-package /packagepath:%EXPAND_DIR%\IE_SUPPORT_amd64_zh-CN.CAB
REM ?拼寫功能。
DISM /image:%MOUNT_DIR% /add-package /packagepath:%EXPAND_DIR%\IE-Spelling-en.MSU
PAUSE
REM ?IE11的企業模式。
DISM /image:%MOUNT_DIR% /add-package /packagepath:%PATCH_DIR%\IE11-Windows6.1-KB2932269-x64.msu
REM 使用記事本建立ei.cfg檔案,依次輸入:[EditionID][Channel]Retail[VL]0,複制到sources目錄下
REM }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} IE11REM {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ USB3 INSTALL
REM USB 3。1是為7系的,5是8系開始的。兩個都添加,不知道是否有問題?
SET PATCH_USB3_1=%PATCH_DIR%\Intel(R)_USB_3.0_Driver_1
SET PATCH_USB3_5=%PATCH_DIR%\Intel(R)_USB_3.0_Driver_5
DISM /image:%MOUNT_DIR% /add-driver:%PATCH_USB3_1% /Recurse /ForceUnsigned
DISM /image:%MOUNT_DIR% /add-driver:%PATCH_USB3_5% /Recurse /ForceUnsigned
REM }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} USB3 INSTALLREM 完成 install.wim
CP ? /q ei.cfg sources
DISM /unmount-wim /mountdir:%MOUNT_DIR% /commit
DEL /q %EXPAND_DIR%\*.*
REM {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{ USB3 BOOT
REM 1 PE, 2 SETUP
DISM /get-wiminfo /wimfile:%INSTALL_WIM%
REM USB 3
DISM /Mount-Wim /Wimfile:%BOOT_WIM% /index:2 /Mountdir:%MOUNT_DIR%
DISM /image:%MOUNT_DIR% /add-driver:%PATCH_USB3_1% /Recurse /ForceUnsigned
DISM /image:%MOUNT_DIR% /add-driver:%PATCH_USB3_5% /Recurse /ForceUnsigned
DISM /unmount-wim /mountdir:%MOUNT_DIR% /commit
REM }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} USB3 BOOT
REM 使用UltraISO将制作好的"install.wim”重新替換Windows7 SP1MSDN系統鏡像中的原install.wim;
REM 将ei.cfg檔案添加到系統sources目錄下,重新儲存為新系統鏡像。