Type list disk — this shows all connected drives. Note the disk number you want to format (e.g., Disk 2).
In the Computer Management window, click Disk Management (under Storage). windows 7 format disk
Type select disk X (replace X with your disk number) and press Enter. Type list disk — this shows all connected drives
Right-click on the drive you want to format. especially for unallocated space
Create a new partition: create partition primary
Type exit to close DiskPart.
Your drive will be formatted and ready to use in seconds. Disk Management gives you more control, especially for unallocated space, partition resizing, or formatting drives that don’t appear in “Computer.”