DiskPart 命令DiskPart commands

适用于:Windows 10,Windows 8.1,Windows 8,Windows 7,Windows Server 2019,Windows Server 2016,Windows Server 2012 R2,Windows Server 2012,Windows Server 2008Applies To: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, and Windows Server 2008 R2, Windows Server 2008

DiskPart 命令可帮助你管理电脑的驱动器(磁盘、分区、卷或虚拟硬盘)。DiskPart commands help you to manage your PC's drives (disks, partitions, volumes, or virtual hard disks). 你必须首先列出,然后选择一个对象来使其成为焦点,然后才能使用 DiskPart 命令。Before you can use DiskPart commands, you must first list, and then select an object to give it focus. 当对象具有焦点时,键入的任何 DiskPart 命令都将作用于该对象。When an object has focus, any DiskPart commands that you type will act on that object.

可以通过使用list disk、list volume、list partitionlist vdisk命令列出可用对象,并确定对象的编号或驱动器号。You can list the available objects and determine an object's number or drive letter by using the list disk, list volume, list partition, and list vdisk commands. List disk、list vdisklist volume命令显示计算机上的所有磁盘和卷。The list disk, list vdisk and list volume commands display all disks and volumes on the computer. 但是,列表分区命令只显示有焦点的磁盘上的分区。However, the list partition command only displays partitions on the disk that has focus. 使用list命令时,将在具有焦点的对象旁边显示一个星号(*)。When you use the list commands, an asterisk (*) appears next to the object with focus.

选择对象时,焦点将保留在该对象上,直至选择其他对象。When you select an object, the focus remains on that object until you select a different object. 例如,如果焦点设置在磁盘0上,并且选择了磁盘2上的卷8,则焦点将从磁盘0转移到磁盘2、卷8。For example, if the focus is set on disk 0 and you select volume 8 on disk 2, the focus shifts from disk 0 to disk 2, volume 8. 某些命令会自动更改焦点。Some commands automatically change the focus. 例如,在创建新的分区时,焦点会自动切换到新的分区。For example, when you create a new partition, the focus automatically switches to the new partition.

只能将焦点放到所选磁盘上的分区。You can only give focus to a partition on the selected disk. 当分区具有焦点时,相关卷(如果有)也具有焦点。When a partition has focus, the related volume (if any) also has focus. 当卷具有焦点时,如果卷映射到单个特定分区,则相关磁盘和分区也会获得焦点。When a volume has focus, the related disk and partition also have focus if the volume maps to a single specific partition. 如果不是这样,则对磁盘和分区的关注会丢失。If this is not the case, focus on the disk and partition is lost.

DiskPart 命令DiskPart commands

若要启动 DiskPart 命令解释器,请在命令提示符下键入:To start the DiskPart command interpreter, at the command prompt type:



本地Administrators组中的成员身份或等效身份是运行 DiskPart 所需的最低要求。Membership in the local Administrators group, or equivalent, is the minimum required to run DiskPart.

可以在 Diskpart 命令解释器中运行以下命令:You can run the following commands in the Diskpart command interpreter:

其他参考Additional references

命令行语法项Command-Line Syntax Key

Windows PowerShell 中的存储 CmdletStorage Cmdlets in Windows PowerShell