VOL

Display the volume label of a disk.

Syntax
      VOL [drive:[drive:]]

If the drive exists, VOL will display it's disk label and serial number and will return an %ERRORLEVEL% of 0.

If the drive does not exist or is not ready (CD/DVD drive with no disk loaded), VOL will return an %ERRORLEVEL% of 1.

If several drives are given, VOL will iterate through and check each of them. If any drive is invalid it will set the errorlevel but will still display information about the others.

Errorlevels

If the Volume label was successfully displayed %ERRORLEVEL% = 0
If Drive not found or bad parameters given %ERRORLEVEL% = 1

VOL is an internal command.

Examples

vol c: h:

From PowerShell:

PS C:\> cmd /c vol D:
PS C:\> Echo $?

“I've found the Nobel label very handy because who'd want to hear anything from Betty Williams, ordinary housewife?” ~ Betty Williams Nobel Prize 1976

Related commands

LABEL - Edit the volume label of a disk.
BCDEDIT - Manage Boot Configuration Data.
PowerShell: Get-CIMinstance Win32_LogicalDisk $label.
Equivalent bash command (Linux): hostname - Print or set system name.


 
Copyright © 1999-2024 SS64.com
Some rights reserved