If you enjoyed this post consider subscribing via or Email
...
ITStuff.ca - ITStaff is all about Windows, VMware, Hyper-V, Virtualization, HP Servers, Blades and other IT Technologies. An invaluable source of Tools and Scripts for IT Network Administrators. A valuable advice, Tips, Tricks and best practices for Net Admins.
@Echo off
%SYSTEMDRIVE%
CD "C:\Program Files\Windows AIK\Tools\PETools"
Set Architecture=x86
Set PEDest=c:\winpe_x86
Set ISOName=winpe_x86.iso
Set removeboot=true
pushd %cd%
call copype.cmd %Architecture% %PEDest%
Dism /Mount-Wim /WimFile:%PEDest%\winpe.wim /index:1 /MountDir:%PEDest%\mount
Dism /image:%PEDest%\mount /Get-Packages
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-hta.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-hta_en-us.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-legacysetup.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-legacysetup_en-us.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-mdac.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-mdac_en-us.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-pppoe.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-PPPOE_en-us.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-scripting.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-scripting_en-us.cab"
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-setup.cab"
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-setup_en-us.cab"
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-setup-client.cab"
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-setup-client_en-us.cab"
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-setup-server.cab"
REM Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-setup-server_en-us.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\winpe-wmi.cab"
Dism /image:%PEDest%\mount /Add-Package /PackagePath:"C:\Program Files\Windows AIK\Tools\PETools\%Architecture%\WinPE_FPs\en-us\winpe-wmi_en-us.cab"
copy "C:\Program Files\Windows AIK\Tools\%Architecture%\imagex.exe" %PEDest%\mount\Windows\System32\
Dism /Unmount-Wim /MountDir:%PEDest%\mount /Commit
Copy %PEDest%\winpe.wim %PEDest%\ISO\sources\boot.wim
IF "%removeboot%"=="true" del /q %pedest%\iso\boot\bootfix.bin
oscdimg -n -b%PEDest%\etfsboot.com %PEDest%\ISO %PEDest%\%ISOName%
popd
ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.1.7100.0
WIM Information:
----------------
Path: D:\Sources\install.wim
GUID: {0d111cde-2c81-41f9-8a12-c6a4ea332f6c}
Image Count: 5
Compression: LZX
Part Number: 1/1
Attributes: 0xc
Integrity info
Relative path junction
Available Image Choices:
------------------------
2407585560
9062
46181
7966805292
0x01C9CFC1
0xAC43B062
0x01C9CFD1
0x1DB61AA6
0
MicrosoftR WindowsR Operating System
Starter
Client
acpiapic
WinNT
Terminal Server
en-US
en-US
6
1
7127
0
0
WINDOWS
Windows 7 STARTER
Windows 7 STARTER
Starter
3064992513
Windows 7 Starter
Windows 7 Starter
9095
46384
8019432535
0x01C9CFC1
0xAC43B062
0x01C9CFD4
0x05378D42
0
MicrosoftR WindowsR Operating System
HomeBasic
Client
acpiapic
WinNT
Terminal Server
en-US
en-US
6
1
7127
0
0
WINDOWS
Windows 7 HOMEBASIC
Windows 7 HOMEBASIC
HomeBasic
3096342833
Windows 7 Home Basic
Windows 7 Home Basic
@echo off
IF {%1}=={} @Echo Please provide a path to the .WIM file. For ex. D:\Sources\install.wim &goto :EOF
SET WIMPATH=%1
SET Images-Num=
SET LoopNum=
SET I=
FOR /F "TOKENS=3 Delims=: " %%a in ('imagex /INFO %1 ^| Find /i "Image Count"') do set Images-Num=%%a
SET /a LoopNum=%Images-Num% + 1
@Echo Index Image Name
:LOOP1
SET /a I=%I% + 1
IF "%I%"=="%LoopNum%" goto END
FOR /F "TOKENS=3 Delims=>,<" %%a in ('Imagex /INFO %1 %I% ^| find /i ""') do @Echo [%I%] %%a
goto LOOP1
:END