This is my practical about the WinPE.
We should format the OS with automatically and officially by using WinPE.
Here is the script startnet.cmd.
Create a WinPE
with Windows ADK.
Run Deployment and Imaging Tools Environment
and execute this command.
copype amd64 \winpe\winpe_c
cd \winpe
Then we should mount the WinPE image to the "mount" file
.
You can copy the build command from Autolaod_for_WinPE/build to "\winpe"
.
imagex /mountrw \winpe\winpe_c\media\sources\boot.wim 1 \winpe\mount
Copy the findstr.exe
to the WinPE.
copy \Windows\System32\findstr.exe \winpe\mount\Windows\system32\
Here is the drivers and packages install for the WinPE. These drivers and packages can be found from "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs"
1.
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-DismCmdlets.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-EnhancedStorage.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-Fonts-Legacy.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-LegacySetup.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-PowerShell.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-Scripting.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-SecureBootCmdlets.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-SecureStartup.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-Setup.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-StorageWMI.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-WDS-Tools.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-WinReCfg.cab
dism /image:\winpe\winpe_c\mount /add-package /packegepath:WinPE-WMI.cab
After, we can copy the startnet.cmd
from Autolaod_for_WinPE/src to the "\winpe\winpe_c\media\Windows\System32"
.
copy startnet.cmd \winpe\winpe_c\media\Windows\System32\
Then, we can umount and commit for the "mount" file
.
imagex /unmount /commit \winpe\winpe_c\mount
imagex /cleanup
Next, we gotta build iso with oscdimg
command2.
oscdimg -bootdata:2#p0,e,bwinpe_c\fwfiles\etfsboot.com#pEF,e,bwinpe_c\fwfiles\efisys.bin -u1 -udfver102 winpe_c\media winpe_f.iso
After, the iso file builded, we should mount that iso file and switch to the iso drive.
Then we'll copy all the folders and files to the "WINPE_F"
of the USB partition.
The install.wim
file3 that can be found from original ISO file "sources\install.wim"
3.
Also, can use the capture
command4 from Autolaod_for_WinPE/build to build your own install.wim.
❗ IMPORTANT
If you want to capture your current OS please ensure that they is perform from another OS environment, such as WinPE. By the way, before that please remove the
startnet.cmd
first from the WinPE.
dism /capture-image /imagefile:install.wim /capturedir:e:\ /scratchdir:scratch /name:win10_c /checkintegrity /verify /bootable /compress:maximum
Footnotes
-
Here is the official manual of WinPE option component. Also can refer to HaroldMitts/Build-CustomPE. ↩
-
Please refer to "Oscdimg Command-Line Options". ↩
-
For the install.wim defination please refer to "Windows Image Files and Catalog Files Overview". About the ESD file please refer to "how to extract install.esd to install.wim" ↩ ↩2
-
How to build own install.wim please refer to "Capture and apply a Windows image" ↩