Drive Status

icemanind

Member
Joined
Mar 20, 2008
Messages
12
Programming Experience
5-10
Is there a way to get the status of a CD-ROM drive? By status, I'm talking about reading status. What I'm trying to do is write a program that displays a "virtual" LED light in my taskbar and I want it to light up everytime my CD-ROM drive is reading a CD. I'd also like one for my hard drive. Is there a way to get the status of a drive? When it reads, when it writes, etc...?

Any help would be appreciated!

Thanks
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,410
Location
Norway
Programming Experience
10+
For logical or physical disks of hard drives you can use the PerformanceCounter component found in Toolbox, I can't find a counter that monitors CD drives. Getting acquainted with performance counters you can easiest do by trying the Windows Performance application (start menu, Administrative tools, Performance), try adding a counter for the category PhysicalDisk, select an instance, use for example the counter name "% Disk Read Time" and "% Disk Write Time". These are the same values you use to configure the component. To read the performance values you use a Timer component and call NextValue method on the counter.
 
Top Bottom