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

select disk ?

list disk

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

clean

create partition primary

select partition 1

active

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.  

format fs=ntfs quick label=”2016TP5”

format fs=fat32 quick label=”2016TP5”

exit

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

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)

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

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


Revision #1
Created 9 October 2023 07:22:49 by Quản trị
Updated 9 October 2023 07:23:14 by Quản trị