DelphiDabbler Code Snippets Database

Snippet Selection

The following snippets from the Code Snippets Database have been requested.

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;

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;

View the whole database.

Go to the DelphiDabbler website.