-
-
Save johnjohnsp1/f2d64ff1f43ef15cba9b09d8394eabe5 to your computer and use it in GitHub Desktop.
Linux BASH script to make bootable Windows USB ISO image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sudo !! | |
echo " | |
__ | |
,-~¨^ ^¨-, _, | |
/ / ;^-._...,¨/ | |
/ / / / | |
/ / / / | |
/ / / / | |
/,.-:''-,_ / / / | |
_,.-:--._ ^ ^:-._ __../ | |
/^ / /¨:.._¨__.; | |
/ / / ^ / | |
/ / / / | |
/ / / / | |
/_,.--:^-._/ / / | |
^ ^¨¨-.___.:^ | |
WIN ISO 2 BOOTABLE USB | |
" | |
if [ "$1" ] & [ "$2" ] | |
then | |
ISO=$1 | |
# https://www.microsoft.com/software-download/windows10ISO | |
USB=$2 | |
FAT="$USB"1 | |
MNT=/mnt/USB | |
mkdir -p $MNT | |
TMP=/mnt/Image | |
mkdir -p $TMP | |
echo "Creating FAT32 bootable UEFI partition..." | |
echo -e 'o\nn\np\n1\n\n\nt\nc\na\nw' | fdisk $USB | |
mkfs.fat $FAT | |
echo "Copying files..." | |
mount $FAT $MNT | |
mount $ISO $TMP | |
cp -r $TMP/* $MNT | |
sync | |
umount $MNT | |
umount $TMP | |
echo "Done" | |
else | |
echo "Usage : win2usb.sh VMs/Win10_1803_English_x64.iso /dev/sdX" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment