如果您有无法从文件资源管理器(File Explorer)格式化的外部硬盘驱动器或USB驱动器,您可以查看本指南。它将帮助您使用 Windows PowerShell 格式化外部硬盘驱动器或 USB 驱动器(format the external hard drive or USB drive using Windows PowerShell)。您可能已经知道Windows PowerShell是一个内置工具,因此您不需要安装任何第三方软件。
Windows 用户可以借助内置选项轻松格式化内部硬盘驱动器、外部HDD或SSD、USB驱动器等。(USB)此选项可在这台电脑或我的电脑(Computer)中找到。有时,由于硬盘驱动器或文件损坏,此特定功能可能会一团糟,您可能无法格式化驱动器。在这样的时刻,你有一些其他的选择。例如,您可以使用磁盘管理(Disk Management)面板、命令提示符(Command Prompt)等来完成工作。同样,您可以使用Windows PowerShell删除和创建分区、更改USB驱动器或硬盘驱动器的文件(File)系统等。
阅读(Read):如何使用命令提示符删除或格式化 C 盘(How to delete or format C drive using Command Prompt)。
使用Windows PowerShell(Windows PowerShell)可以做什么?
您可以更改外部硬盘驱动器或USB驱动器的以下内容-
(Format External Hard Drive)使用PowerShell格式化外置硬盘
要使用Windows PowerShell格式化外部硬盘驱动器或USB驱动器,请执行以下步骤 -
- 将USB或外部硬盘驱动器插入计算机
- 以管理员权限打开Windows PowerShell
- 识别您要删除的驱动器
- 输入命令。
首先,您需要插入外部硬盘驱动器或笔式驱动器,以便您的计算机可以完成这项工作。之后,您需要以管理员权限打开Windows PowerShell 。为此,请按Win+X,然后选择Windows PowerShell (Admin)。
现在您需要确定要格式化的磁盘。为此,输入以下命令 -
Get-Disk
您应该在“友好名称”(Friendly Name )列中找到您的外部硬盘驱动器的名称。另外,您需要记下硬盘的编号。
要启动该过程,请输入此命令 -
Clear-Disk -Number 2 -RemoveData
您需要将数字 2 替换为分配给驱动器的原始编号。在此示例中,我们要格式化带有数字2的(2)Sony Storage Media(查看上面的屏幕截图)。如果您的外部硬盘驱动器显示不同的数字,则可能会有所不同。
现在您应该会收到一条确认消息。键入Y并按 Enter 按钮。
完成该过程需要几秒钟。现在,您需要输入以下命令 -
New-Partition -DiskNumber 2 -UseMaximumSize -IsActive -DriveLetter Z
它将帮助您创建分区。此外,您应该了解有关此命令的两件事。首先(First),数字2代表您之前格式化的驱动器。其次(Second),Z代表将分配给外部硬盘驱动器或USB驱动器的驱动器号。
输入该命令后,将出现一个弹出窗口来格式化您的磁盘。您可以使用该弹出窗口选项,也可以使用以下命令 -
Format-Volume -DriveLetter Z -FileSystem FAT32 -NewFileSystemLabel USB
这是您应该知道的一件重要的事情。如果要将驱动器格式化为FAT32文件系统,则需要在命令中选择它。然而,如果你要使用NTFS文件系统,同样的命令应该是这样的——
Format-Volume -DriveLetter Z -FileSystem NTFS -NewFileSystemLabel USB
如果您选择NTFS ,它可能会比(NTFS)FAT32多花几秒钟的时间。
输入最后一条命令后,就可以正常使用外接硬盘或U(USB)盘了。
您也可以使用命令提示符格式化 USB 笔式驱动器。
Format External Hard Drive or USB drive using Windows PowerShell
If you have an external hard driνe or USB drive that you cannot format from File Explorer, you can check out this guide. It will help you to format the external hard drive or USB drive using Windows PowerShell. As you might already know that Windows PowerShell is an in-built tool, you do not need to install any third-party software.
Windows users can easily format an internal hard drive, external HDD or SSD, USB drive, etc. with the help of the in-built option. This option can be found in This PC or My Computer. Sometimes, this specific functionality can be a mess because of the corrupted hard drive or file, and you may not be able to format the drive. At such a moment, you have some other options. For example, you can use the Disk Management panel, Command Prompt, etc. to get the job done. Likewise, you can use Windows PowerShell to delete and create partitions, change the File system, etc. of your USB drive or hard drive.
Read: How to delete or format C drive using Command Prompt.
What can you do using Windows PowerShell?
You can change the following things of an external hard drive or USB drive-
- Format the hard drive
- Change File system
- Create partition
- Change drive letter
Format External Hard Drive using PowerShell
To format the external hard drive or USB drive using Windows PowerShell, follow these steps-
- Plugin the USB or external hard drive to your computer
- Open Windows PowerShell with admin privilege
- Recognize the drive that you want to delete
- Enter the command.
First, you need to plug in your external hard drive or pen drive so that your computer can do the job. After that, you need to open the Windows PowerShell with administrator privilege. For that, press Win+X, and select Windows PowerShell (Admin).
Now you need to identify the disk that you want to format. For that, enter the following command-
Get-Disk
You should find the name of your external hard drive in the Friendly Name column. Also, you need to note down the number of the hard disk.
To initiate the process, enter this command-
Clear-Disk -Number 2 -RemoveData
You need to replace the number 2 with the original number that is assigned to your drive. In this example, we want to format the Sony Storage Media (check the above screenshot), which is carrying the number 2. It might be different if your external hard drive is showing a different number.
Now you should get a confirmation message. Type Y and hit the Enter button.
It should take a couple of seconds to complete the process. Now, you need to enter the following command-
New-Partition -DiskNumber 2 -UseMaximumSize -IsActive -DriveLetter Z
It will help you create a partition. Also, there are two things you should know about this command. First, the number 2 represents the drive that you formatted earlier. Second, the Z represents the drive letter that will be assigned to the external hard drive or USB drive.
After entering that command, a popup will appear to format your disk. You can use that popup window option, or you can use the following command-
Format-Volume -DriveLetter Z -FileSystem FAT32 -NewFileSystemLabel USB
Here is one crucial thing that you should know. If you want to format the drive in the FAT32 file system, you need to choose that in the command. However, if you’re going to use the NTFS file system, the same command should look like this-
Format-Volume -DriveLetter Z -FileSystem NTFS -NewFileSystemLabel USB
If you choose NTFS, it might take a couple of more seconds than FAT32.
After entering the last command, you will be able to use the external hard drive or USB drive regularly.
You can format USB Pen Drive using Command Prompt as well.