Are you thinking of creating a Windows 10 bootable USB drive and do you like using the command line tool? Below we will see how you can do it without the Windows 10 Media Creation Tool (x86 - x64) because you just like to use the command line.
Before you get started, you'll need the Windows 10 .ISO file - you can download it from various unofficial sources, but also from Microsoft itself, through the Windows 10 Media Creation Tool.
Open the command prompt as an administrator (search for cmd, right-click and select "Run as Administrator"), type "diskpart" without the quotation marks, and press enter.
Alternatively, open the Start menu, type “diskpart” without the quotes, and click button Yes, if prompted by UAC.
Connect your USB drive. Type "list disk" without quotes and press enter.
From the Size column, you can understand where your USB drive is located
Our USB is at number 1, so we will type the next command which is “select disk 1” without the quotes. Press enter.
If you have not made a backup of your USB content, it is your last chance.
Immediately then type "clean" without quotes and press enter to delete the USB.
We will now prepare the USB to become bootable. Type "create partition primary" without quotes and press enter.
Then type "select partition 1" without the quotation marks and press enter.
Immediately after "active" without quotes and press enter.
Finally, enter the command "format fs = fat32" without quotes and press enter. The command will format your USB drive in the FAT32 format using the quick routine. (If you choose to use formatting in NTFS instead of FAT32, you will then have to run a different command to pass compatible boot manager files to your USB so that the device is bootable.)
This procedure it will take some time, depending on the size and speed of your USB drive.
Immediately after, type “assign” without the quotes and press enter to assign a new letter unitdisc to your USB. Your USB drive will probably open automatically (if it doesn't, you'll find it on My Computer or This Computer). Remember the drive letter (in our case it is H).
You can now extract the contents of the .ISO file (from Windows Explorer or using your favorite tool exports, and copy them directly to the USB drive.
Another way is to mount the .ISO with your favorite tool (we used UltraISO) and from there to make the command line transfer as described below:
Close the diskpart window and reopen cmd.
Type "xcopy g: *. * / S / e / fh:" without the quotation marks, where "g:" is the drive letter that contains the .iso file and "h:" is the USB letter. Don't worry if install.wim takes a while to copy: It's the largest file on the disk.
Type "exit" without the quotation marks and press enter.
You're done. Now you can install Windows 10 from your USB drive.