Changes the volume label of the specified drive.
DriveSetLabel Drive , NewLabel
Type: String
The drive letter followed by a colon and an optional backslash (might also work on UNC paths and mapped drives).
On Linux and macOS, specify the volume's mount point instead, such as / or /media/user/BACKUP.
Type: String
If omitted, the drive will have no label. Otherwise, specify the new label to set.
An OSError is thrown on failure, including when the operation is refused for lack of privileges, and on Linux when the volume's filesystem is not one of those listed below.
Changing a volume label is a privileged operation on every platform. Expect it to require an elevated process on Windows, and root on Linux and macOS.
Requires findmnt and the labeling utility for the volume's filesystem: e2label (ext2/ext3/ext4), btrfs filesystem label, xfs_admin, fatlabel (FAT/FAT32/msdos), ntfslabel (NTFS) or exfatlabel.
DriveGetLabel, Drive functions