Finding The Pacemaker Drive
Posted: Sat Sep 29, 2012 7:11 pm
To find the Pacemaker drive you need to iterate through all your drives looking for a removable drive, that is "ready", and has a volume label which matches your Pacemaker. I found that my Pacemaker volume was "Pacemaker" whereas DJ Pip found his was "PACEMAKER". It could be something to do with the different versions of Windows we have (Vista 32-bit for me, Windows 7 64-bit for Pip). Therefore you should uppercase the volume of any drive you are testing, and compare it to "PACEMAKER".
Here is the code in vb .Net
Here is the code in vb .Net
Code: Select all
Private DeviceVolumeLabel As String = "PACEMAKER"
Public Function FindPacemakerDrive() As Boolean
PacemakerDrive = ""
PacemakerPresent = False
For Each drive As DriveInfo In DriveInfo.GetDrives()
If drive.DriveType = DriveType.Removable AndAlso drive.IsReady Then
If drive.VolumeLabel.ToUpper = DeviceVolumeLabel Then
PacemakerDrive = drive.Name
PacemakerPresent = True
Return True
End If
End If
Next drive
Return False
End Function