Recent

Author Topic: is there a "better" GetDriveType()  (Read 893 times)

speter

  • Full Member
  • ***
  • Posts: 227
is there a "better" GetDriveType()
« on: November 21, 2020, 04:04:11 am »
G'Day Folks,

I have a simple project which lists some info about the attached drives etc (project attached).

In part, it uses GetDriveType(), which returns the following (there is an image, if you care :) )
  C: Fixed Drive
  D: CD-ROM Drive
  E: Floppy Drive (removable)
  F: Fixed Drive

In reality, drives D+E are a USB stick (with an embedded virtual CD); and drive F is a portable SSD (not fixed).
(Drive C is also a SSD).

Is there a better function for getting information about the drives!?
Also, are there functions for getting the partition info?

I have a bunch of these USB sticks and would love the delete the CD partition from most of them, but that is different story... :) I could probably use Partition-Magic or a similar app to do that.

cheers
S.

I climbed mighty mountains, and saw that they were actually tiny foothills. :)

Laz 2.0.10 / FPC 3.2.0 / Windows 10 (64bit)

GetMem

  • Hero Member
  • *****
  • Posts: 3519
Re: is there a "better" GetDriveType()
« Reply #1 on: November 21, 2020, 08:54:54 am »
Quote
Is there a better function for getting information about the drives!?
Also, are there functions for getting the partition info?
Try this: https://theroadtodelphi.com/2011/10/25/wmi-tasks-using-delphi-%E2%80%93-disks-and-file-systems/

 

TinyPortal © 2005-2018