0% found this document useful (1 vote)
439 views

Making WIMBoot Image (Windows 8.1 and 10)

This document provides instructions for creating a WIMBoot image that can be used to deploy Windows 8.1 or 10 from a USB drive. It describes using DISM commands to export the install.wim and winre.wim files, mount the Windows image, and export a WIMBoot version of install.wim. It also provides a sample script to automatically calculate the needed size for the Images partition and configure the partitions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
439 views

Making WIMBoot Image (Windows 8.1 and 10)

This document provides instructions for creating a WIMBoot image that can be used to deploy Windows 8.1 or 10 from a USB drive. It describes using DISM commands to export the install.wim and winre.wim files, mount the Windows image, and export a WIMBoot version of install.wim. It also provides a sample script to automatically calculate the needed size for the Images partition and configure the partitions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

=========================================Making WIMBoot Image (Windows 8.

1 and 1
0)====================================
You can do this tutorial in Windows 8.1 Update 1 and Windows 10 Preview or RTM
Open Command Prompt and Run As Admin
Type the following commands
Md C:\mount\WinRE
md C:\mount\Windows
md C:\MSU
md C:\Images
dism /get-wiminfo /wimfile:"C:\images\install.wim"
Follow this if there is multiple Wim inside
================================================================================
=====================================
Dism /Export-Image /SourceImageFile:C:\images\install.wim /SourceIndex:x /Destin
ationImageFile:C:\Images\install1.wim
(where x is the index number from WIM)
md c:\images\original
move c:\images\install.wim c:\images\original\install.wim
rename c:\images\install1.wim install.wim
================================================================================
=====================================
Dism /Mount-Image /ImageFile:"C:\Images\install.wim" /Index:1 /MountDir:C:\mount
\Windows
Dism /Export-Image /SourceImageFile:C:\mount\Windows\Windows\System32\Recovery\w
inre.wim /SourceIndex:1 /DestinationImageFile:C:\Images\winre.wim
Del C:\mount\Windows\Windows\System32\Recovery\winre.wim
Dism /Unmount-Image /MountDir:C:\mount\Windows /Commit
Dism /Export-Image /WIMBoot /SourceImageFile:C:\Images\install.wim /SourceIndex:
1 /DestinationImageFile:C:\Images\install_wimboot.wim
Then Make a bootable USB Windows installation (Windows 8.1 up) and copy the inst
all_wimboot.wim, rename it to install.wim and winre.wim
================================================================================
=====================================
Make a auto CMD script that makes installation easy
Open Notepad and paste this script:
goto __start
/*************************************************************
Sample Script: CalculateAndCreateWIMBootPartition.cmd
Use this script to calculate the size needed for the WIMBoot
Images partition after applying your final factory settings.
**************************************************************/
REM The script starts here
:__start
@echo off
echo %date%-%time%:: Start of script %0 ,,,
if "%1" equ "" (
echo This script calculates the size needed for the Images partition and sets i
t up.
echo Usage:
echo CalculateAndCreateWIMBootPartition.cmd ^<letter of Windows volume^> ^<path
to install.wim and custom.wim^> ^<path to winre.wim^> ^<additional free space t
o be added to Images partition in megabytes. If no additional space is needed, u
se 0.^>
echo Example:
echo CalculateAndCreateWIMBootPartition C: C:\Recycler\WIMs\ C:\Recycler\WIMs 3
00

exit /b 0
)

REM
REM
set
REM
set

--- Constants used to calculate free space --Overhead Ratio: assume 6 MB overhead per 1000 MB size
/a NTFS_OVERHEAD_RATIO=500/497
Per-Partition Overhead: 5 MB per partition
/a NTFS_OVERHEAD_BASE=5

REM
REM
y.
set
REM

Megabytes-to-Millions Ratio:
This ratio converts values from megabytes to millions of bytes, approximatel
/a mega_million_ratio=205/215
--------- Constants -------------

REM Drive letter of the Windows partition. Example: C:


set user_volume=%1
REM Path that contains install.wim and custom.wim. Example: C:\Recycler\WIMs\
set wimfile_path=%2
REM Path that contains winre.wim. Example: C:\Recycler\WIMs
set winre_wim_path=%3
REM Additional size to be added to Images partition in megabytes. Example: 300
set more_size=%4
echo Check input Windows volume {%user_volume%} is accessible:
echo dir %user_volume%\ /a
dir %user_volume%\ /a
if not exist %user_volume%\ (
echo %user_volume%\ not found. Exiting script.
pause
exit /b 3
)
echo Check if the install.wim and custom.wim files {%wimfile_path%} are accessib
le:
echo dir %wimfile_path%\ /a
dir %wimfile_path%\ /a
if not exist %wimfile_path%\install.wim (
rename install_wimboot.wim install.wim
)
if not exist %wimfile_path%\install.wim (
echo %wimfile_path%\install.wim not found. Exiting script.
pause
exit /b 3
)
echo Check if the winre.wim file {%winre_wim_path%} is accessible:
echo dir %winre_wim_path%\ /a
dir %winre_wim_path%\ /a
if not exist %winre_wim_path%\winre.wim (
echo %winre_wim_path%\winre.wim not found. Exiting script.

exit /b 3
)
echo --------- Calculate install.wim size ,,,
for %%A in (%wimfile_path%\install.wim) do (
set install_wim_file_bytes=%%~zA
echo install.wim is [%install_wim_file_bytes%] bytes.
)
set /a install_wim_file_MB=%install_wim_file_bytes:~0,-6%+0
echo After cutting off last 6 digits = [%install_wim_file_MB%]
set /a install_wim_file_MB=%install_wim_file_MB%*205/215
echo Final approximate size: [%install_wim_file_MB%] MB
set /a custom_wim_file_MB=%custom_wim_file_bytes:~0,-6%
echo After cutting off last 6 digits = [%custom_wim_file_MB%]
set /a custom_wim_file_MB=%custom_wim_file_MB%*205/215
echo Final approximate size: [%custom_wim_file_MB%] MB
echo --------- Calculate {%winre_wim_path%\winre.wim} size ,,,
for %%A in (%winre_wim_path%\winre.wim) do (
set winre_wim_file_bytes=%%~zA
echo winre.wim is [%winre_wim_file_bytes%] bytes.
)
set /a winre_wim_file_MB=%winre_wim_file_bytes:~0,-6%
echo After cutting off last 6 digits = [%winre_wim_file_MB%]
set /a winre_wim_file_MB=%winre_wim_file_MB%*205/215
echo Final approximate size: [%winre_wim_file_MB%] MB
echo Calculate Images partition size ,,,
echo Adding 50MB free space to input size {%more_size%}. This ensures Images par
tition have 50MB free space.
set /a more_size=%more_size%+50
set /a wim_partition_size_MB=%install_wim_file_MB%+%custom_wim_file_MB%
echo Size sum of install.wim and custom.wim = {%wim_partition_size_MB%} MB
set /a wim_partition_size_MB=%wim_partition_size_MB%+%winre_wim_file_MB%
echo Total size of the 3 .WIM files = {%wim_partition_size_MB%} MB
set /a wim_partition_size_MB=%wim_partition_size_MB%+%more_size%
echo Size after adding specified space and 50MB = {%wim_partition_size_MB%} MB
set /a wim_partition_size_MB=%wim_partition_size_MB%+%NTFS_OVERHEAD_BASE%
set /a wim_partition_size_MB=%wim_partition_size_MB%*500/497
echo Final Images partition size = {%wim_partition_size_MB%} MB
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo Pres ENTER key to create partition layout
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
pause
echo select disk 0 >> dp0dps.txt
echo clean >> dp0dps.txt
echo convert gpt >> dp0dps.txt
rem == 1. System partition (ESP) =================== >> dp0dps.txt

echo create partition efi size=100 >> dp0dps.txt


echo format quick fs=fat32 label="System" >> dp0dps.txt
rem == 2. Microsoft Reserved (MSR) partition ======= >> dp0dps.txt
echo create partition msr size=128 >> dp0dps.txt
rem == 3. Windows partition ======================== >> dp0dps.txt
echo create partition primary >> dp0dps.txt
echo shrink desired=%wim_partition_size_MB% >> dp0dps.txt
echo format quick fs=ntfs label="Windows" >> dp0dps.txt
echo assign letter=c >> dp0dps.txt
rem === 4. Images partition ======================== >> dp0dps.txt
echo create partition primary >> dp0dps.txt
echo format quick fs=ntfs label="Images" >> dp0dps.txt
echo assign letter=m >> dp0dps.txt
echo set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" >> dp0dps.txt
echo gpt attributes=0x8000000000000001 >> dp0dps.txt
echo list volume >> dp0dps.txt
echo exit >> dp0dps.txt
diskpart /s dp0dps.txt
del dp0dps.txt
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo Pres ENTER key to copy wim's files
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
pause
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo Copying files...............
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
md "M:\Windows Images\"
copy install.wim "M:\Windows Images\install.wim"
md C:\Recycler\Scratch
DISM /Apply-Image /ImageFile:"M:\Windows Images\install.wim" /ApplyDir:C: /Index
:1 /WIMBoot /ScratchDir:C:\Recycler\Scratch
C:\Windows\System32\bcdboot C:\Windows
md M:\Recovery\WindowsRE
echo f | xcopy winre.wim M:\Recovery\WindowsRE\winre.wim /h
C:\Windows\System32\Reagentc /SetREImage /Path M:\Recovery\WindowsRE /Target C:\
Windows
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo **************************************************************
echo Pres ENTER key to restart
echo **************************************************************
echo **************************************************************

echo **************************************************************
echo **************************************************************
echo **************************************************************
pause
exit
Then save as. And name it as CalculateAndCreateWIMBootPartition.cmd
Also paste it in USB Drive
Plug the USB in device (tablet/laptop/PC) and boot it.
Once booted, press Shift-F10 to appeare the command prompt and type CalculateAnd
CreateWIMBootPartition C: D: D: 0
wait...
Then you can now enjoy your OS...:) Install drivers for it.
To add some space enter it in CMD in admin
Dism /Cleanup-Image /Online /StartComponentCleanup
If you want to backup your current installation, boot again in USB and bring CMD
by pressing Shift-F10 and type
DISM /Capture-Image /WIMBoot /ImageFile:"E:\others\install_wimboot.wim" /Capture
Dir:C: /Name:"WIMBoot Windows 8.1 with Update 1" /ScratchDir:C:\Recycler\Scratch
================================================================================
=====================================
Thanks...:)

You might also like