Code Snippets Database
Control Box
Requested snippets
This page displays 2 requested snippets.
You can choose a category, perform a search or generate a Pascal unit containing the snippets by using the Control Box.
- DeleteVolumeName
-
Deletes an existing volume label on a given drive. Returns True on success and False on failure.
function DeleteVolumeName(ADrive: string): Boolean; begin Result := Windows.SetVolumeLabel(PChar(ADrive), ''); end;
Kind of Snippet: RoutineRequired units: Windows.Required snippets: None.Supported Compilers:D2 D3 D4 D5 D6 D7 D2005
(Win32)D2006
(Win32)D2007 D2009
(Win32)D2010
(Win32)Free
Pascal











- SetVolumeName
-
Sets the name of the volume on a given drive. Returns True on success and False on failure.
function SetVolumeName(const ADrive, AName: string): Boolean; begin Result := Windows.SetVolumeLabel(PChar(ADrive), PChar(AName)); end;
Kind of Snippet: RoutineRequired units: Windows.Required snippets: None.Supported Compilers:D2 D3 D4 D5 D6 D7 D2005
(Win32)D2006
(Win32)D2007 D2009
(Win32)D2010
(Win32)Free
Pascal










Fails and returns False if the process has insufficient privileges to set the volume name.
