Paths used in this section (based on mount points specified when DiskPart was used to prepare the disk - see here) -
NOTE/WARNING - install.wim can contain multiple images. Adjust image/index number in the steps below to select the required Windows version. As an example, install.wim from a Windows 11 source .iso contains 10 different images, including Enterprise, Education and Professional versions of Windows 11 - image/index 3 is Enterprise. For an overview of the Windows Image (WIM) format, see here.
The Deployment Image Servicing and Management tool (DISM) is backwards compatible, however previous versions of DISM may not support all commands when newer Windows sources are used. To avoid compatibility issues, the DISM version included in the Windows source ISO (\sources\dism.exe) can be used to apply/extract the contents of an image in \sources\install.wim.
For information about the DISM /Apply-Image command syntax, enter the following in a command prompt
Extract the contents of image 1 in F:\sources\install.wim to the target drive (T:\) - adjust paths and image number as required.
wimlib can be used as an alternative to DISM. Syntax -
If using wimlib, extract the contents of image 1 in F:\sources\install.wim to the target drive (T:\) - adjust paths as required.
"BCDBOOT command line tool is used to copy critical boot files to the system partition and to create a new system BCD store" (https://winteltools.com/bcdboot/).
For more information about the bcdboot command syntax, enter the following in a command prompt (see here for output from Windows 10 version 21H2 bcdboot)
Create BIOS and UEFI boot files on the target drive (R:\), using the templates embedded in the operating system files extracted to drive T:\ in the preceding step - adjust paths as required.
"Storage area network (SAN) functionality enables a computer to mount disks and other storage devices automatically from other computers. By configuring the SAN policy....you can control whether or not disks are automatically mounted and which disks can be mounted. ." (https://docs.microsoft.com/en-us/).
Windows To Go created with the workspace creator (now deprecated) automatically applied SANPolicy 4 (makes internal disks offline - all external disks and the boot disk are online). SANPolicy 3 appears to add more robust protection when running Windows To Go as all disks with the exception of the boot disk will be offline, preventing accidental writes on the host computer.
Mount the offline registry hive T:\Windows\system32\config\system as HKLM\_TEMP (adjust path as required)
Edit the registry hive mounted in the previous step to configure SANPolicy 3 (adjust SANPolicy as required)
Unmount the registry hive mounted as HKLM\_TEMP
The bcdedit tool is used to edit entries in the Boot Configuration Database (the BCD store). Whilst bcdedit is beyond the scope of this guide, a brief overview of bcdedit and BCD paths may be helpful -
Setting the bootmenupolicy to legacy will display a basic boot menu, with improved boot speeds. More detailed information about bootmenupolicy is available here.
Edit bootmenupolicy in the BIOS boot menu (adjust paths as required)
Edit bootmenupolicy in the UEFI boot menu (adjust paths as required)
Edit the BIOS boot menu and change the name (description) of the menu entry (adjust paths/description as required)
Edit the UEFI boot menu and change the name (description) of the menu entry (adjust paths/description as required)
After completing all of the steps listed above, boot from the USB device to complete Windows setup. This is covered in more detail here.
Document date - 6th July 2022