Create Bootable Windows Server 2016, 2019, 2022, Windows 10, 11 USB Thumb Drive for Installing OS – no .exe required BIOS & UEFI


These procedures were written and tested using Windows Server 2016 but will work on any version of Windows Server or Windows Desktop version 8 or above.  They should work on prior versions of Windows 10, Windows 8, Windows Server 2012, Windows 7 and Windows Vista and Windows Server 2008 or Windows Server 2008 R2.  Note: this post DOES NOT use any downloadable .EXE.  This is the long way.  If you want to create a bootable USB with Windows 10 using the executable, see: Download Windows 10 and Create bootable USB Thumb Drive for Booting to Installation PLUS Data Migration.  The USB drive I created with these instructions was used to successfully install Windows Server 2016 TP5 and 2016 on bare metal with only one internal drive which was wiped during the installation. I have also fully tested Windows Server 2019.

If you do not have the media, you will need to download.  See https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-technical-preview for the Technical Preview of Windows Server 2016.  You could also download from MSDN.MICROSOFT.COM or other subscription service.

1) Double-click the ISO file to mount it (or mount the ISO) and make note of the drive letter.  In my case it is drive I:

2) Put in the USB Thumb Drive Key in the computer and make note of the drive letter and the size of the disk.  In my case it is D: and 32gb  You will likely need at least an 8gb drive as the bits will require 4.9gb.

image

3) You need to run an elevated command prompt. Start | type cmd | Right-click cmd (top of menu) | Run as Administrator  (accept the elevation request)

URGENT NOTE:  The following commands will completely wipe out your disk without warning so make sure you select the proper disk.  I strongly recommend you have a good backup of all drives attached to the machine before running.  I also recommend you disconnect all external drives to limit mistakes.


NOTE: It is best to use a USB 2 drive because some hardware cannot boot to USB 3.

4) Next you will run Diskpart to prepare the disk for the OS {question mark “?” below should be replaced with the disk number of the drive you are using}

diskpart

list disk

  • Make a note of the disk number of the drive you want to format and make bootable.  Replace the ? in the next command with the number of the disk displayed in the list disk command results.

select disk ?

list disk

  • Note: after you run list disk again, the drive should be prefaced with an asterisk “*” Make sure this is the case, so you do not wipe the wrong drive

— CAUTION: the next line is the one that wipes the drive

clean

create partition primary

select partition 1

active

  • Note: if you are installing a version later than 2016 (eg 2019, 2022) you may get an error on the Active Command.

    “The selected disk is not a fixed MBR disk. The ACTIVE command can only be used on fixed MBR disks.”

    • You can just keep going, for later OS’s this is not a required step.  The bootsect command later will take care of everything

The following command will defer depending on the configuration of the hardware you will be installing the OS on.  If you are not sure, you can use the CTRL key to go into BIOS/SETUP to determine. UEFI is more secure.  

  • BIOS: If your machine uses BIOS the fs switch needs to be fs=ntfs

format fs=ntfs quick label=”2016TP5”

  • UEFI: if the destination hardware uses UEFI fs switch needs to be fs=fat32.

format fs=fat32 quick label=”2016TP5”

  • Note: You can change the text in the quotes of the format command to whatever you want the label to be on the USB disk.  You can also change this later through the UI – Limit 11 characters.
  • Note: if you have issues copying files later, come back to the format and run the command without the word quick in it. e.g. 
    format fs=ntfs label=”WinSvr2019”

exit

  • You will get a message that you are Leaving DiskPart…

5) Now we need to copy the boot sector.  You should still be in the command prompt window.  Run the following commands to change to the right drive and folder:

Note: replace the I: below with your mounted ISO drive letter

  • I:
  • cd boot
  • Note: Run “bootsect /help” for detailed usage instructions on bootsect.
  • Note: /nt60 is for Windows Vista, Windows Server 2008 or above.
    • Prior versions of windows (e.g. XP) must be /nt52  

Replace e: in the below command with the drive letter of your USB drive

bootsect /nt60 e:

Target volumes will be updated with BOOTMGR compatible bootcode.  This disk can also be used to fix boot loader on a machine that is having problems.

You will get a message:
Bootcode was successfully updated on all targeted volumes.

If you get the following error or similar: 
Updated NTFS/Fat32 filesystem bootcode.  The update may be unreliable since the volume could not be locked during the update:
Access is denied.

  • This usually happens when the drive is open when trying to transfer the boot sector.  During transfer, the drive will be dismounted and remounted in the background without notice.
  • You will need to close any open windows with that drive and try again.
    • The best option is to:
      • Make sure you are using the correct drive letter
      • make sure all files and folders on the drive are closed. 
      • Make sure “Disk Manager” is closed. 
      • Make sure you do not have a command prompt window open and currently positioned on the USB drive.
      • If needed, you could disconnect the USB then connect it again.  Make sure you are using the proper drive letter because when you disconnect and reconnect there is always the possibility you could get a different letter. 
      • You could also use the /force switch but be careful as if you are using the wrong drive, you could cause major damage to your computer. 

6) Now we just need to copy files… (You should still be in the DOS Command window)

  • Run the xCopy command to copy all files… replace drive letters below with your drive letters.
    • I:\*.* is the Source ISO image drive
    • D:\    is the Destination USB drive
    • The switches are required to make sure you get all the right files including system files and sub folders

xcopy I:\*.* D:\ /E /H /F

  • NOTE: when xCopy processes the install.wim file it will take an exceptionally long time.  This file is exceptionally large (4+gb) so it takes forever, let it go, it will eventually finish.

7)  Once the copy finishes, you can boot to the USB drive and it will be treated like an attached DVD.  Remember, you may have to tell your computer to boot to the USB device which is often done from <F12> or other CTRL key to boot options in your BIOS / UEFI settings.

Diskpart Command-Line Utility Syntax and Description