ボリュームの属性を表示、設定、またはクリアします。
Syntax
attributes volume [{set | clear}] [{hidden | readonly | nodefaultdriveletter | shadowcopy}] [noerr]
Parameters
Parameter | Description |
---|---|
set | フォーカスがあるボリュームの指定された属性を設定します。 |
クリア | フォーカスがあるボリュームの指定された属性をクリアします。 |
readonly | ボリュームを読み取り専用に指定します。 |
非表示の | ボリュームを非表示に指定します。 |
nodefaultdriveletter | ボリュームに既定のドライブ文字を割り当てないように指定します。 |
shadowcopy | ボリュームをシャドウ コピー ボリュームに指定します。 |
noerr | スクリプト専用です。 エラーが発生しても、エラーが発生しなかったかのように DiskPart はコマンドの処理を続けます。 このパラメーターは、エラー発生すると、DiskPart はエラー コードを生成して終了します。 |
Remarks
On basic master boot record (MBR) disks, the hidden, readonly, and nodefaultdriveletter parameters apply to all volumes on the disk.
On basic GUID partition table (GPT) disks, and on dynamic MBR and gpt disks, the hidden, readonly, and nodefaultdriveletter parameters apply only to the selected volume.
A volume must be selected for the attributes volume command to succeed. Use the select volume command to select a volume and shift the focus to it.
Examples
選択したボリュームの現在の属性を表示するには、次のように入力します。
attributes volume
選択したボリュームを非表示または読み取り専用として設定するには、次のように入力します。
attributes volume set hidden readonly
選択したボリュームの非表示属性と読み取り専用属性を削除するには、次のように入力します。
attributes volume clear hidden readonly