Windows 10 Drive Format via Terminal

diskpart
list disk

The command will list all the hard drives on your computer.

select disk 3

Here, disk 3 is the flash drive plugged into the system. Be sure to select the number that corresponds to the flash drive inserted in your system.

 list partition

The command will list all the partitions on the USB flash drive.

 select partition 1

In this case, we assume partition 1 is the partition we want to delete. Make sure to select the number that corresponds to the partition on your flash drive.

delete partition

Credit