共用方式為


attributes disk

顯示、設定或清除磁碟的屬性。 當此命令用來顯示磁碟的目前屬性時,啟動磁碟屬性表示用來啟動電腦的磁碟。 針對動態鏡像,它會顯示包含開機磁碟區開機叢集的磁碟。

Important

必須選取磁碟, attributes disk 指令才能成功。 使用 select disk 指令來選取磁碟,並將焦點移至該磁碟。

Syntax

attributes disk [{set | clear}] [readonly] [noerr]

Parameters

Parameter Description
set 設定具有焦點之磁碟的指定屬性。
清晰 清除具有焦點之磁碟的指定屬性。
readonly 指定磁碟是唯讀的。
noerr 僅適用於腳本。 發生錯誤時,DiskPart 會繼續處理命令,就像沒有發生錯誤一樣。 如果沒有此參數,錯誤會導致 DiskPart 結束並出現錯誤碼。

Examples

若要檢視所選磁碟的屬性,請輸入:

attributes disk

若要將選取的磁碟設定為唯讀,請輸入:

attributes disk set readonly