The MCSB (Mount, Copy, Set Boot) tool is used to create bootable media efficiently.
This tool uses three main steps to ensure your bootable media is prepared for installation and usage on real hardware.
- Mount, the first step, which mounts the provided ISO image based on the path.
- Copy, the second step, copies the files of the mounted image to your provided USB or other device path.
- Set Boot, the final step, sets your external media boot configuration and others to ensure you can boot into the flash drive or SSD.
Due to Windows Image (.WIM) and .ESD sizes in ISOs, some USBs will be formatted accordingly. With smaller D:\sources\install.wim (replace D:\ with your USB letter) or install.esd sizes, you should format the partition as FAT32 for compatibility between UEFI and Legacy BIOS (MBR). For larger images up to 4 Gigabytes and above, format the drive as NTFS to ensure your USB drive can boot properly with modern systems and space for your .WIM or .ESD image. I encourage formatting USB drives as so, according to the OS; image sizes can vary with editions and versions.
| OS | Format As |
|---|---|
| Windows 7 SP1 and older | FAT32 |
| Windows Server 2012 and newer | NTFS |
This tool was primarily designed for PowerShell due to its efficiency.
Adding custom drivers has been implemented; you're welcome! $WinPEDriver$ path has been added to load drivers on WinPE/Setup boot automatically. Windows Vista and below do not support this method and require manual driver loading into the base image or installing drivers after the setup process. Sorry!
More parameters, but these parameters are optional.
Let your .inf, .sys, and .cat files join the installation. Sure, you can also implement the drivers into the install.wim/install.esd and boot.wim images, however, this takes time and can take up excessive storage.
The support for CDs and DVDs with isoburn.exe has been added in the recent commit 6e7bdaf. So, enjoy!
C:\Users\JohnDoe\MCSBtool> .\mcsb.ps1 -BIOS "UEFI" -ISOImage "C:\Users\JohnDoe\images\Windows11.iso" -DrvPath "C:\Users\JohnDoe\MyDrivers\" -USBPath "F:\"In order is where you perform these steps. However, this process assumes you have acknowledged:
- Size of Install.WIM file inside of a mounted ISO file before copying files, FAT32 is recommended if the file is below ~3.7 GiB
- Size of your drive (CD/DVD/USB, USBs are recommended for modern installations, while DVDs are recommended for legacy versions. Windows Vista works on USB installs, but below may require a DVD. CDs cannot hold a modern or pre-modern installation. Floppy support is unknown.)
- Version of OS to install. The process assumes you acknowledge what you need to install the OS. Check online for more information! Windows Server 2003 R2, Windows Server 2003, Windows XP, and below require the NT52/NT51 bootloader, which used the legacy NTLDR (NT Loader) bootloader, while versions Windows Vista and above require the NT60 bootloader (BOOTMGR), introduced with the kernel version Windows NT 6.0. Fun fact, Windows NT 6.0 refers to Windows Vista.
- ISO or optical disc image file. The process simply assumes you have this to proceed.
Because of the script's intended view on Microsoft Windows, manual steps may need to be performed for other OSes.
Now, you can proceed with the steps in the specified order:
- Mount your image file
- Copy the files inside the newly mounted virtual drive to your USB/CD/DVD drive.
- Make sure your information is correct. The disk scheme and firmware are also detailed for more legacy OSes. GPT and legacy BIOS are not natively compatible, including MBR and UEFI firmware.
- Finally, set and apply boot information such as boot entries, boot code (for Windows), and other vital information based on your operating system and system type.
Regarding drivers, if you cannot run an installer for the driver(s) you need for Windows, you can also use PnP Utility (pnputil.exe) or Windows Driver Kit (also known as WDK). You should find a version that supports the intended operating system version in the table below (Driver Development Kit / Device Development Kit included):
| OS | WDK Version(s) | Note(s) |
|---|---|---|
| Windows Vista, XP SP3/later, 7 SP1, Server 2008 & R2, Server 2003 SP1/later & x64 Editions | WDK 7.1.0 | Outdated and no longer available from Microsoft. Required to build for these versions. |
| Windows 2000 | Windows 2000 DDK | Outdated and no longer available from Microsoft. |
| Windows 7, 8, 8.1, Server 2012, Server 2016, 10, 11, Server 2022, Server 2019 | WDK 10.0 | The latest WDK 10.0 releases are bundled with the Windows SDK, which are also compatible with Visual Studio 2022. You must have WDK 10.0.19041.0 or an earlier version to build drivers for Windows 7, 8, or 8.1, unless you have manually configured it for later versions of WDK 10.0. Visual Studio 2019 or older may be required for WDK 10.0.19041.0 or earlier versions. |
| Windows 11, Server 2025 | WDK 11.0 | Requires Visual Studio 2022 and can build for versions of Windows 10 and later, including Windows Server 2016, 2019, and 2025. It does not support building drivers for versions earlier than Windows 10. Microsoft recommends using the latest WDK version for the corresponding version(s) of Windows. |
Using pnputil.exe, you can run (e.g.):
pnputil.exe -i -a C:\Users\JaneDoe\drivers\*.infThe command above adds driver packages to the store and installs them for an existing device with the Hardware ID provided in the .inf files (in versions below Windows 10, refined commands introduced in various versions).
For Windows 10 and above, you can use:
pnputil.exe /add-driver C:\Users\JaneDoe\drivers\*.inf /installWhen using DevCon, you must first find the Hardware ID of the device listed in the .inf file that comes with your .cat and/or .sys file(s) by viewing it in other software such as Notepad. Once you find it, copy it, and you can use the command below (example) to install a driver:
devcon.exe install C:\Users\NotDoe\drvpack\ATIx64\wddmAMDRHD.inf [Device hardware ID here]You can replace install with update in the command to update an existing driver. You should use the hardware ID found in the device's details tab in Device Manager to update it with DevCon.
Extended UEFI support is a major change that has been added in the commit 7f13f7. A re-formatted optical disc image (copied over from Rufus's FAT12 .img file since many modern and even pre-modern systems cannot mount 70s-80s era file systems, et cetera.) has been added to the root of the repository; you can install this with the script in case of offline media creation. The script also assumes you have at least 272 MiB free of unallocated space on the same disk as the USB/CD/DVD's partition, where the boot files only use 1-3 MiB of space. You may use your minimum allowed partition size for this, so prepare this partition manually.
This script is a work in progress.
- Smart file system formatting. Add a file size check for install.wim on the mounted ISO drive BEFORE the copying files step, but only if the USB is formatted as FAT32. If over 4 GiB (or simplify to 3.7 GiB) was verified as the file size from the UDF-mounted drive, prompt to split the file into 2-3 versions (mounted drives are only read, so prompt the user for a directory to store these files temporarily and then proceed to write these after the copying process by deleting install.wim, if *.swm is present in %TMP% and copy these .swm files to USB:\sources. This might be an extensive process with DISM.exe. However, this idea has not worked in beta testing and was actually scrapped.
-
Will you add a GUI version?
-
No, I will not add a GUI version, as simplicity is intended.
-
Will there be Linux or Mac versions?
-
This script is intended for support on Microsoft Windows. You can use a container or a virtual machine to use this tool and proceed forward. This is because the use of PowerShell and system functions is built in and used by Windows.
-
What about Windows Vista and below?
-
For legacy versions where PowerShell is not installed by default, it is recommended to install it to use this script.