8.5.30 SetVolumeLabel or SetVolLabel (set a disk volume label)
- Purpose
-
Sets the volume label of a disk.
- Syntax
SetVolumeLabel (DiskName [, LabelName]) SetVolLabel (DiskName [, LabelName])
- Arguments
-
- DiskName
-
Specify the disk volume as a character string or as a variable that stores this value. You can omit the colon (:).
- LabelName
-
Specify the volume label to set, using a character string or a variable that stores this value.
This value is optional. If you omit this value, a zero-length string ("") is assumed.
- Description
-
The SetVolumeLabel or SetVolLabel command sets the volume label of a disk. The command returns True on successful execution, or False if an error occurs.
- Note
-
Execute the script file as a user who has administrator permissions. For details, see 1.8.3 Effect of the executing user on command behavior.
- Example
Dim drvName, volName drvName = "E:" volName = GetVolumeLabel (drvName) If volName = Empty Then SetVolumeLabel (drvName, "Script shared drive") End
- JP1/Script version
-
Supported from JP1/Script 05-10.