Label (command)
In computing, the label command is a utility available in multiple operating systems such as DOS, IBM OS/2, Microsoft Windows, and ReactOS. Its purpose is to create, modify, or remove a volume label on logical drives including hard disk partitions and floppy disks. When used without additional options, label adjusts or clears the existing volume label.
History
Initially created to assign labels to floppy disks for easy identification, this command also functions with other storage devices like mapped network drives.
Introduced in MS-DOS starting from version 3.1 and IBM PC DOS version 3, label operates as an external command. Early MS-DOS versions (4.x and earlier) utilized label.com, whereas MS-DOS 5.0 and later Windows editions employ label.exe. The command is incorporated within DR DOS 6.0, and FreeDOS includes a GPL-licensed variant developed by Joe Cosentino.
For contemporary Microsoft Windows releases, administrative privileges are necessary to alter disk labels. Additionally, the Windows dir command reveals the volume label and serial number alongside directory contents.
Comparable capabilities exist in Unix-like environments through different utilities tailored to specific file systems; for instance, e2label is used to manage labels on ext2 file systems.
Syntax
LABEL [drive:][label] LABEL [/MP] [volume] [label]
Parameters:
drive:Indicates the drive letter associated with the target drive.labelSpecifies the new volume label to assign.volumeRefers to a drive letter (with colon), mount point, or volume identifier.
Options:
/MPInterprets the specified volume as a mount point or volume name.
Note: The /MP option is optional when providing a volume name.
Example
<syntaxhighlight lang="doscon"> C:\Users\root>label D: Backup </syntaxhighlight>
Supported file systems
FAT volume labels
- Limited to 11 characters maximum, including spaces but not tabs, using the system’s OEM code page.
- Prohibited characters include: ? / \ | . , ; : + = [ ] < > "
- Labels are stored in uppercase regardless of input case.
NTFS volume labels
- Supports up to 32 Unicode characters.
See also
- Vol (command) — Shows disk volume label and serial number information.
- List of DOS commands
Further reading
- Cooper, Jim. Special Edition Using MS-DOS 6.22, Third Edition. Que Publishing, 2001.
- O'Reilly, Tim; Mott, Troy; Glenn, Walter. Windows 98 in a Nutshell. O'Reilly Media, 1999.
- Mueller, John Paul. Windows Administration at the Command Line. John Wiley & Sons, 2007.