Formatting a flash drive using the Command Prompt (CMD) in Windows is a straightforward process, but it involves careful steps to ensure you don't accidentally erase important data. Here's a step-by-step guide:
- Open Command Prompt as Administrator: - Press Win + X and select Command Prompt (Admin) or Windows PowerShell (Admin).
- Alternatively, press Win + R, type cmd, and press Ctrl + Shift + Enter.
 
- Identify the USB Drive: - Type diskpart and press Enter. This will open the DiskPart utility.
- Type list disk and press Enter. This command lists all the disks connected to your computer.
- Identify your USB drive by its size. For example, if your USB drive is 16 GB, it might be listed as "Disk 1" with a size of 16 GB.
 
- Select the USB Drive: - Type select disk X and press Enter, replacing X with the number corresponding to your USB drive. For example, if your USB drive is "Disk 1", you would type select disk 1.
 
- Clean the USB Drive: - Type clean and press Enter. This command will remove all partitions and data from the selected disk.
 
- Create a New Partition: - Type create partition primary and press Enter. This command creates a new primary partition on the USB drive.
 
- Format the USB Drive: - Type format fs=ntfs quick and press Enter to format the drive with the NTFS file system. If you prefer the FAT32 file system, you can use format fs=fat32 quick instead.
- The quick parameter speeds up the formatting process. If you want a full format, omit quick, but this will take longer.
 
- Assign a Drive Letter: - Type assign and press Enter. This command assigns the next available drive letter to the USB drive.
- Optionally, you can specify a drive letter by typing assign letter=X, replacing X with your desired letter.
 
- Exit DiskPart: - Type exit and press Enter to leave the DiskPart utility.
- Type exit again and press Enter to close the Command Prompt.
 
Example Commands