label (command)
Cross-platform | |
---|---|
Type | Command |
License | MS-DOS, PC DOS, Windows, OS/2: Proprietary commercial software FreeDOS, ReactOS: GNU General Public License |
Website | docs |
In
label
changes the current volume label or deletes the existing label.
History
The command was originally designed to label floppy disks as a reminder of which one is in the machine. However, it can also be applied to other types of drive such as mapped drives.[5]
It is available in MS-DOS versions 3.1 and later and IBM PC DOS releases 3 and later.[6]
It is an external command. MS-DOS 4.0x and earlier used label.com
as the external file. MS-DOS 5.0 and Windows use label.exe
as the external file.
In modern versions of Microsoft Windows, changing the disk label requires elevated permissions.[5] The Windows dir
command displays the volume label and serial number (if it has one) as part of the directory listing.
In Unix and other Unix-like operating systems, the name of the equivalent command differs from file system to file system. For instance, the command e2label
can be used for ext2 partitions.
Syntax
LABEL [drive:][label] LABEL [/MP] [volume] [label]
Arguments:
drive:
Thisdrive letterof a drive.label
Specifies the label of the volume.volume
Specifies themount point, or volume name.
Flags:
/MP
Specifies that the volume should be treated as a mount point or volume name.
Note: If volume
name is specified, the /MP
flag is unnecessary.
Example for the command.
C:\Users\root>label D: Backup
Supported file systems
Limitations
FAT volume labels
FAT volumes have the following limitations:[5]
- Volume labels can contain as many as 11 character bytes and can include spaces, but no tabs. The characters are in the OEM code pageof the system that created the label.
- Volume labels cannot contain the following characters: ? / \ | . , ; : + = [ ] < > "
- Volume labels are stored as upper-case regardless of whether they contain lower-case letters.
NTFS volume labels
- Unicode characters.[5]
See also
- Vol (command) — Displays the disk volume label and serial number.
- List of DOS commands
References
- ISBN 0078819040.
- ^ "JaTomes Help - OS/2 Commands". www.jatomes.com. Archived from the original on 2019-04-14.
- ^ Microsoft TechNet Label article
- ^ https://github.com/reactos/reactos/blob/master/base/shell/cmd/label.c [dead link]
- ^ a b c d Label - Disk label - Windows CMD - SS64.com
- ISBN 0-7356-1812-7.
- ^ MS-DOS and Windows command line label command
- ^ "DR DOS 6.0 User Guide Optimisation and Configuration Tips" (PDF). Archived from the original (PDF) on 2019-09-30. Retrieved 2019-08-12.
- ^ "FreeDOS 1.2 Updates Package - label (FreeDOS Base)". Ibiblio.org. 2021-11-19. Retrieved 2022-09-04.
Further reading
- Cooper, Jim (2001). Special Edition Using MS-DOS 6.22, Third Edition. ISBN 978-0789725738.
- Tim O'Reilly; Troy Mott; Walter Glenn (1999). Windows 98 in a Nutshell: A Desktop Quick Reference. ISBN 978-1565924864.
- John Paul Mueller (2007). Windows Administration at the Command Line for Windows Vista, Windows 2003, Windows XP, and Windows 2000. ISBN 978-0470165799.