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 2008 R2、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. 當您使用清單命令時,星號(*)會出現在具有焦點的物件旁邊。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:



若要執行 DiskPart,至少需要本機Administrators群組的成員資格或同等許可權。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