In this article, we will discuss how to properly format a USB drive using Windows PowerShell and the Command Prompt. These methods can come in handy if you are a command-line fanatic and want to save time by formatting a USB drive in a few easy commands, rather than having to navigate through several windows to get the job done.
How to Format Drive using PowerShell
Create Single Partition
Windows PowerShell is a powerful command-line tool in Windows that allows you to perform administrative tasks on your computer. Follow the steps given below to format a USB drive using this tool and create a single partition.
How to Format Drive using PowerShell Create Single Partition Create Multiple Partitions How to Format Drive using Command Prompt Format Drive with Drive Letter Format Drive Without Drive Letter Closing Words
Note: This method works regardless of the drive letter being assigned to the USB drive. After entering the last command, the USB drive will be accessible and will automatically open in Windows Explorer.
Create Multiple Partitions
You can also create multiple partitions of a USB drive using PowerShell, rather than just a single big partition. Here is how to create multiple partitions of a USB drive using PowerShell: You will now have to create at least 2 partitions on the drive using the steps given above. We would like to highlight that you may be prompted with a message stating the following as you are performing steps 4, 5, or 6 above: This message can be ignored as shortly after, Windows completes the formatting process of the partition and creates the partition successfully.
How to Format Drive using Command Prompt
Diskpart is a command line utility used to manage Windows computer drives, including disks, partitions, volumes and virtual drive disks. It can be used to format a drive safely and securely. We will use diskpart utility to format the drives from Command Prompt. You can also format a USB drive using Command Prompt. However, this tool requires 2 different methods for a situation, depending on whether there is already a drive letter assigned to a USB partition.
Format Drive with Drive Letter
Perform the following steps using the Command Prompt to format the drive if a drive letter is already assigned to it. Note: This method will only format the existing partition(s) on the USB drive and will not resize them. That’s it! The drive partition will now be formatted successfully.
Format Drive Without Drive Letter
If your USB partitions do not yet have a drive letter, use this method to format them using the Command Prompt. The USB drive will now be formatted successfully and will automatically open in Windows Explorer.
Closing Words
Although many of you would prefer to format a drive using the GUI-based Explorer, using the command-line has its advantages. If you are a sysadmin who spends most of their time on the command line, especially PowerShell, then you would know that it enables you to perform all sorts of administrative tasks from a single interface. Similarly, you can now also format drives, according to your needs and specifications, directly from Command Prompt or Windows PowerShell, without having to switch between windows.