CmdID

CmdID / Commands / attributes

attributes volume

Displays, sets, or clears the attributes of a volume. Windows commands reference

On Windows

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0
attributes volume [{set | clear}] [{hidden | readonly | nodefaultdriveletter | shadowcopy}] [noerr]

To display the current attributes on the selected volume, type

attributes volumeIdentify

To set the selected volume as hidden and read-only, type

attributes volume set hidden readonlyIdentify

To remove the hidden and read-only attributes on the selected volume, type

attributes volume clear hidden readonlyIdentify
setSets the specified attribute of the volume with focus.
clearClears the specified attribute of the volume with focus.
readonlySpecifies that the volume is read-only.
hiddenSpecifies that the volume is hidden.
nodefaultdriveletterSpecifies that the volume does not receive a drive letter by default.
shadowcopySpecifies that the volume is a shadow copy volume.
noerrFor scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code.