Windows Bootable USB stick

I had a hard time creating a bootable USB stick of Windows 8.1 as I do not own a computer with Windows on it and unetbootin does not work anymore with Windows 8.1. So here is the procedure:

First of all, you must have an iso file of Windows 8/8.1 on your hard drive and a USB stick of at least 5GB.

  1. Mount the iso:

     sudo mount -t udf -o loop,ro,unhide /path/to/file.iso /mnt
    
  2. Run fdisk with the name of the USB stick:

     sudo fdisk /dev/sdc
    
  3. Delete all existing partition with d, which deletes one partition at a time, and create a new one using n.

  4. The new partition must have a size of at least 5GB. Mark it bootable and set its type to 7 (HPFS/NTFS/ExFat).

  5. Write changes and exit fdisk.

  6. Create a FAT-32 file system in the new partition:

     sudo mkfs.vfat -F 32 /dev/sdc1
    
  7. Mount this partition in a previously created folder:

     sudo mount /dev/sdc1 /media/usbstick
    
  8. Copy all the files from the ISO on the USB stick:

     sudo cp -r /mnt/* /media/usbstick
    
  9. Synchronize the file systems:

     sudo sync
    
  10. Unmount both the ISO and the USB stick:

    sudo umount /media/usbstick
    sudo umount /mnt