CmdID / Commands / attributes
attributes volume
Displays, sets, or clears the attributes of a volume. Windows commands reference
On Windows
Windows
attributes volume [{set | clear}] [{hidden | readonly | nodefaultdriveletter | shadowcopy}] [noerr]
To display the current attributes on the selected volume, type
attributes volumeIdentifyTo set the selected volume as hidden and read-only, type
attributes volume set hidden readonlyIdentifyTo remove the hidden and read-only attributes on the selected volume, type
attributes volume clear hidden readonlyIdentifysetSets 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.