Get Volume Name

This function used to get volume name.

function VolumeName(DriveName: Char): string;
var
max, Flags: DWORD;
Buf: array [0..MAX_PATH] of Char;
begin
try
GetVolumeInformation(PChar(DriveName + ‘:\’), Buf, sizeof(Buf), nil, max, Flags, nil, 0);
Result := StrPas(buf);
except
result := ”;
end;
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Edit1.Text := VolumeName(‘C’);
end;

Download: Source Code

Incoming search terms:

  • delphi get drive name
  • delphi GetVolumeInformation
  • delphi XE volume label
  • delphi volume
  • delphi get volume name
  • delphi get volume label
  • delphi get drive label
  • delphi get disk label
  • komponen tmxprotector delphi xe
  • get drives names delphi
This entry was posted in System. Bookmark the permalink.

One Response to Get Volume Name

  1. Adams says:

    Thanks for your source code

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please copy the string ojPPss to the field below: