How to Create Windows PE/RE Media ISO File Or USB in ADK
On this topic, you will learn how to create Windows PE/RE Media (ISO file or a bootable USB drive), which could be a windows recovery or installation image using Windows Assessment and Deployment Kit (ADK) deployment tools and ADK Windows PE Add-ons.
Note: This topic is to create a bootable Windows PE media manually. To see how to create a WinPE or WinRE media automatically using auto batch file, read this topic.
This is the summary of the manual steps:
- Step 1: Download & Install ADK and Windows PE add-on and other files
- Step 2: Create working folder of Windows PE files
- Step 3: Customize Windows PE
- Step 4: Create a bootable media:
- Create an ISO File
- Create a bootable USB drive
- PART 1: MANUAL METHOD:
- PART 2: AUTOMATIC METHOD:
- PART 3: TROUBLESHOOTING ERRORS:
- VIDEO:
PART 1: MANUAL METHOD:
Step 1: How to Install ADK and Windows PE add-ons?
- Download the ADKsetup file and start it
- Select “Install Windows Assessment and Deployment Kit to this Computer” option and then click Next to continue.
- Click Accept option to continue
- Click Install to start download and installation processes.
- After installing the ADK, download ADKWinPESetup file and start it
- Follow the setup wizard instructions to install Windows Preinstallation Environment toolkit.
- Read this topic for more details about installing the ADK and Windows PE add-on.
- Download the ISO file of windows 10 or windows 11 according to the installed edition in your computer.
- Download the 7zip x-64 app from this link and then install it.
Step 2: How to Create a Working Folder of Windows PE Files?
- Type “Deployment” into search box and then start the Deployment and Imaging Tools Environment as an administrator.
- Execute the following command to create a working folder of the Windows PE files:
- copype amd64 C:\WinPE_amd64
- You can replace the C with another partition letter if you want.
- copype amd64 C:\WinPE_amd64
Step 3: How to Customize Windows PE?
- There are many customizations that can be done to the windows image, such as, adding an update, adding a video or network driver and many more customizations, however, on this video you will learn how to customize the type of boot file either by adding a file of full windows installation or just a file of a recovery image.
- But if you want to create a simple ISO image of Windows PE without modification, execute this command:
- Makewinpemedia /iso C:\WinRE_amd64 C:\WinRE_amd64\WinRE.By.VMTechs.iso
- Also to create a bootable USB drive of Windows PE without customization, connect a USB drive to your computer and then execute this command:
- Makewinpemedia /ufd C:\WinRE_amd64 J:
- Where J is the drive letter of the USB flash drive.
- Makewinpemedia /ufd C:\WinRE_amd64 J:
- Note: After customizing the windows image, you can either create an ISO image file or create a bootable USB directly. In both cases, the created media could be either a full windows image for installation or just a recovery image.
3.1. How to create a Recovery image using the WinRE.wim file?
- To create a Recovery image using the WinRE.wim file, do the followings:
- Double click the ISO file of installed windows to mount it
- Run Command prompt as administrator
- Change the CMD path to the installation path of 7zip app using this command:
- CD /D C:\Program Files\7-Zip
- Extract the WinRE.wim image from mounted ISO image of windows to the working folder using this command:
- 7z e H:\sources\install.wim -OC:\WinRE_amd64\media\sources\ 6\Windows\System32\Recovery\WinRE.wim
- Also you can copy the WinRE.wim file from Windows partition or from Recovery partition using one of the following commands:
- xcopy ?:\RECOVERY\WINDOWSRE\WinRE.wim C:\WinRE_amd64\media\sources\ /K /I /H /Y
- Replace the “?” by the letter of Recovery partition. Read this topic for more details.
- xcopy C:\WINDOWS\SYSTEM32\RECOVERY\WinRE.wim C:\WinRE_amd64\media\sources\ /K /I /H /Y
- xcopy C:\RECOVER\WINDOWSRE\WinRE.wim C:\WinRE_amd64\media\sources\ /K /I /H /Y
- xcopy ?:\RECOVERY\WINDOWSRE\WinRE.wim C:\WinRE_amd64\media\sources\ /K /I /H /Y
- Delete boot.wim file using this command:
- DEL C:\WinRE_amd64\media\sources\boot.wim
- Rename WinRE.wim to boot.wim using this command:
- Ren C:\WinRE_amd64\media\sources\WinRE.wim boot.wim
3.2. How to create a windows installation media with single windows edition?
- If you want to create a windows installation media with a single windows edition, extract the desired Edition from mounted ISO image to the working folder using this command:
- Dism /Export-Image /SourceImageFile:H:\sources\install.wim /SourceIndex:6 /DestinationImageFile:C:\WinRE_amd64\media\sources\Install.wim
- The number 6 on the command indicates that the windows professional is the extracted edition.
- The H is the letter of mounted windows ISO file.
- Dism /Export-Image /SourceImageFile:H:\sources\install.wim /SourceIndex:6 /DestinationImageFile:C:\WinRE_amd64\media\sources\Install.wim
- If you want to create a windows installation media with all editions in the ISO file, copy Install.wim file to the working folder using this command:
- XCOPY H:\sources\install.wim C:\WinRE_amd64\media\sources\ /K /I /Y
- The H is the letter of mounted windows ISO file.
- XCOPY H:\sources\install.wim C:\WinRE_amd64\media\sources\ /K /I /Y
Unlike when using WinRE.wim file, you should not delete the Boot.wim file when using Install.wim file.
Step 4: how to Create a bootable media of either a USB drive or ISO file?
4.1. How to Create ISO Image file Using CMD?
- Execute this command to create an ISO file of customized media:
- Makewinpemedia /iso C:\WinRE_amd64 C:\WinRE_amd64\WinRE.By.VMTechs.iso
- Notice that this and the next command in part number 4.2. are to be executed using Deployment and Imaging Tools Environment and not from Command prompt.
- Makewinpemedia /iso C:\WinRE_amd64 C:\WinRE_amd64\WinRE.By.VMTechs.iso
- The created ISO file could be either a recovery image from WinRE.wim file, or a full windows installation media with Install.wim file based on the customization in step number 3.
4.2. How to Create a Bootable USB Drive Using CMD?
- To create a bootable USB from customized media, do the followings:
- Connect a USB drive to your computer
- Execute this command to create a Bootable USB Flash Drive Directly:
- Makewinpemedia /ufd C:\WinRE_amd64 J:
- Replace the J with the letter of the USB flash drive in your computer.
- Makewinpemedia /ufd C:\WinRE_amd64 J:
- All data on the USB drive will be lost after this operation, so take a backup copy of your important files inside the USB before starting.
- The created USB drive also could be either a recovery image or a full windows installation media, based on the customization in step number 3.
PART 2: AUTOMATIC METHOD:
- You can also use the automatic batch file to create a bootable USB or an ISO file of windows image automatically. To use automatic CMD bat file, do the followings:
- Download the ISO file of windows 10 or windows 11 based on the installed windows edition in your computer.
- Double click the ISO file of installed windows to mount it.
- Download Create-WIM-ISO-or-USB.zip from this link and then extract it into your computer.
- Open the extracted folder
- Right-click the Create-WinRE-or-WIM-By-VMTechs.bat file and the select Run as Administrator option.
- Choose the desired option from the shown list in the CMD window of batch script, and the follow on-screen instructions.
- Type the number of the chosen option into CMD window and then press Enter from keyboard.
For more details about making a bootable Windows PE Media automatically, open this link.
PART 3: TROUBLESHOOTING ERRORS:
You may get an error while creating the Bootable USB drive or while creating the ISO file of windows PE media. The following are the most common errors you may face with the possible solutions.
ERROR 1: Failed to format “j:”; DiskPart errorlevel -2147024809:
This error may appear while creating a bootable USB drive due to bad disk formatting.
- SOLUTION:
- Run the CMD as Administrator
- Type DISKPART and press Enter from keyboard
- Type LIST DISK and press Enter to show the available disks
- Select the USB drive using SEL DISK command followed by the ID number of the USB drive.
- For example, if the USB drive take the number 3 on the list of your disks, then execute the following command to select it:
- SEL DISK 3
- For example, if the USB drive take the number 3 on the list of your disks, then execute the following command to select it:
- Type CLEAN and press enter to delete partitions and everything inside the USB drive.
- Create new primary partition using this command:
- CREATE PART PRIMARY
- Format the USB drive partition using this command:
- format quick fs=ntfs label=VMTechs
- OR
- format fs=ntfs label=”VMTechs”
- Type ASSIGN and press enter to add a free letter to the USB partition
ERROR 2: Failed to set the boot code on j:.
This error may appear due to the antivirus app prevent the bootect.exe tool from accessing the USB partition.
SOLUTION:
Disable antivirus or allow bootsect.exe to access \Device\Harddisk?\DR?? form Windows Security Notifications.
VIDEO:
For more details about creating a bootable Windows Media (ISO file or USB drive), watch this video with step by step tutorial: