Dela via


Label

Creates, changes, or deletes the volume label (that is, the name) of a disk. Used without parameters, label changes the current volume label or deletes the existing label.

Syntax

label [Drive**:**][label]

label [/MP][volume][label]

Parameters

Drive :   : Specifies the drive letter (followed by a colon) of the disk you want to name.

label   : Specifies the name for the volume.

/MP   : Specifies that the volume should be treated as a mount point or volume name.

volume   : Specifies the drive letter (followed by a colon), mount point, or volume name. If a volume name is specified, the /MP parameter is unnecessary.

/?   : Displays help at the command prompt.

Remarks

  • Windows displays the volume label as part of the directory listing. If a volume serial number exists, Windows displays this number as well.

  • Label command messages

    If you do not specify a label when you use the label command, label displays a message in the following format:

    Volume in drive A is xxxxxxxxxxx 
    

Volume Serial Number is xxxx-xxxx Volume label (11 characters, ENTER for none)?

The "Volume Serial Number" part of the message is not displayed if the disk has no serial number.

You can type the volume label you want or press ENTER to delete the current label. If a disk has a label and you press ENTER for none, **label** prompts you with the following message:

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml">Delete current volume label (Y/N)?Press Y to delete the label; press N to keep the label.</pre>
  • Limitations on volume label names

    A volume label can contain as many as 32 characters for NTFS volumes and as many as 11 characters for FAT volumes and can include spaces but no tabs.

    FAT volume labels cannot contain any of the following characters:

    * ? / \ | . , ; : + = [ ] < > "

    This limitation does not apply to NTFS volumes.

    For FAT volumes, volume labels are stored as uppercase regardless of whether they contain lowercase letters. NTFS volume labels retain and display the case used when the label was created.

Examples

To label a disk in drive A that contains sales information for July, type:

label a:sales-july

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Command-line reference A-Z

Dir

Vol