kevinward66
asked on
hard drive info
anyone know where i can get info on my hard drive, ie the name and size, is it in the registry? can somebody give me the necessary code?
thanks
kevin ward
thanks
kevin ward
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi Cesario, I havn't seen you around from long time
Welcome back again :o)
Welcome back again :o)
The most common volume info routines:
procedure DriveInfo(Drive: Char);
type
TDriveType = (dtUnknown, dtNoDrive, dtFloppy, dtFixed, dtNetwork, dtCDROM, dtRAM);
var
x: integer;
VSize, VFree: int64;
VLabel, FSys: array[0..$FF] of char;
SNr, FL, SysFlag: DWord;
begin
if not(GetVolumeInformation(P Char(Drive +':\'), VLabel, SizeOf(VLabel), @SNr, FL, SysFlag, FSys, SizeOf(FSys))) then VLabel := '_None_';
// VLabel = Volume Label
// SNr = Serial Number
// FL = Max Filename Length
// SysFlag = Volume Attributes
// FSys = File System (FAT / FAT32 / NTFS etc.)
x := GetDriveType(PChar(Drive+' :\'));
// x = TDriveType (See above)
VSize := DiskSize(Ord(UpCase(Drive) )-64);
VFree := DiskFree(Ord(UpCase(Drive) )-64);
// VSize = Volume Size
// VFree = Free space
end;
GL!
procedure DriveInfo(Drive: Char);
type
TDriveType = (dtUnknown, dtNoDrive, dtFloppy, dtFixed, dtNetwork, dtCDROM, dtRAM);
var
x: integer;
VSize, VFree: int64;
VLabel, FSys: array[0..$FF] of char;
SNr, FL, SysFlag: DWord;
begin
if not(GetVolumeInformation(P
// VLabel = Volume Label
// SNr = Serial Number
// FL = Max Filename Length
// SysFlag = Volume Attributes
// FSys = File System (FAT / FAT32 / NTFS etc.)
x := GetDriveType(PChar(Drive+'
// x = TDriveType (See above)
VSize := DiskSize(Ord(UpCase(Drive)
VFree := DiskFree(Ord(UpCase(Drive)
// VSize = Volume Size
// VFree = Free space
end;
GL!
http://www.torry.net/systeminfo.htm