I agree that Disk Utility can certainly be a pain in the ass at times, and youre not the only one that sometimes just bite the bullet and uses Windows to clean drives!
If you're willing to pay for it DiskWarrior is the one.
If you dont want to spend ay money, then use diskutil which is available in Terminal and heres some instructions on how to use it:
http://www.theinstructional.com/guides/disk-management-from-the-command-line-part-1
http://www.theinstructional.com/guides/disk-management-from-the-command-line-part-2
Do be extremely careful and never rush it when formatting using the Terminal, it is incredibly easy to type one letter or number wrong and erase things you dont want to erase. I've seen it far too many times in my career and would be irresponsible of me not give you that disclaimer!
^ EXCELLENT links I was just using these a few hours ago in order to work on partitioning an external USB into 2 partitions.
@HenryAZ you should reference this.
@1madman1 when going the route of Terminal ... first use
diskutil list
(this will help identify all disks internal and external as noted in the 2 links I've quoted from another helper in this thread).
diskutil list disk2
(this'll show the first connected USB or external drive, usually begins with disk2 or disk2s1 /s2 for partitions)
diskutil listFilesystems
(this will show file systems you can use: MS-DOS FAT32 was one you where after)
I keep several small shell scripts to use diskutil for my most common needs. This one is for partitioning a new disk with one partition. The diskID is starred out (to force me to get the correct one) and the NAME must be changed to whatever you want the disk to be named. And of course uncomment the command line and save before running it. That way I don't use it accidentally. I call it:
Part-NewDisk-OnePartition-GetDeviceIDFirst
Code:
#!/bin/sh
# /usr/bin/sudo /usr/sbin/diskutil partitionDisk /dev/disk** 1 GPT jhfs+ NAME 100%
/usr/bin/sudo /usr/sbin/diskutil list
And having these shell script all ready, I don't have to consult the man pages for diskutil every time.
seems your code is a bit lengthy you don't have to invoke diskutil from it's location to use it within terminal "sudo /usr/sbin/diskutil"
Code:
diskutil partitionDisk /dev/disk2 GPT JHFS+ New 0b
The first three parts of the command are self explanatory, there's the actual diskutil command followed by the option partitionDisk and the disk's identifier /dev/disk(n). You'll also recognise JHFS+ as the filesystem, followed by the label to give the newly-created volume. "GPT" is of course the GUID Partition Table
the guide in the second link quoted above for 'multiple partitioning' did not work for me in High Sierra and had me confused for about 30mins (while drinking

)
my solution was:
Code:
diskutil partitionDisk /dev/disk2 MBRFormat "MS-DOS FAT32" CLOVER 500M JHFS+ macOS R
First partition called "CLOVER" in MasterBootRecord (MBR Format) this forces the need for UpperCase letters for the first partition (lowercase in FAT32 is not accepted). This also forced 500 Megabytes for this partition.
Second partition called "macOS" using HFS+ Journaled (non case sensitive) to use the rest of the free disk space of my external 64GB USB stick.
result in screenshot attached.
end of line, Dilinger.