Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Formatting a USB drive is a common task that can be necessary for various reasons, such as removing all data, changing the file system, or preparing the drive for a new use. In the Windows environment, this can be accomplished using graphical tools like File Explorer or using command-line tools such as Command Prompt (CMD) and PowerShell. This article will guide you through the process of formatting a USB drive using CMD and PowerShell.
Open Command Prompt as Administrator:
Win + X
and select "Command Prompt (Admin)" or "Windows PowerShell (Admin)" from the menu.Identify the USB Drive:
diskpart
and press Enter. This will open the DiskPart utility.list disk
and press Enter. This will display all connected drives. Identify your USB drive by its size.Select the USB Drive:
select disk X
(replace X with the disk number of your USB drive) and press Enter.Clean the Drive:
clean
and press Enter. This will remove all partitions and data from the drive.Create a New Partition:
create partition primary
and press Enter.Format the Drive:
format fs=ntfs quick
and press Enter to format the drive with the NTFS file system. You can replace ntfs
with fat32
or exfat
if needed.Assign a Drive Letter:
assign
and press Enter. This will assign the next available drive letter to the USB drive.Exit DiskPart:
exit
and press Enter to close DiskPart.Open PowerShell as Administrator:
Win + X
and select "Windows PowerShell (Admin)" from the menu.Identify the USB Drive:
Get-Disk
to list all connected drives. Note the number of your USB drive.Clear the Drive:
Clear-Disk -Number X -RemoveData
(replace X with the disk number) and confirm the action.Initialize the Drive:
Initialize-Disk -Number X
to initialize the disk.Create a New Partition:
New-Partition -DiskNumber X -UseMaximumSize -AssignDriveLetter
to create a new partition and assign a drive letter.Format the Drive:
Format-Volume -DriveLetter Y -FileSystem NTFS -NewFileSystemLabel "USBDrive"
to format the drive. Replace Y
with the assigned drive letter, and you can change NTFS
to FAT32
or exFAT
if desired.Formatting a USB drive using CMD or PowerShell provides a powerful alternative to graphical tools, especially when dealing with stubborn drives or when scripting is required. Both methods offer flexibility in choosing the file system and partitioning options.