Umím to pro VB6, třeba to pomůže.
Dim fso As Object, drv As Object, xI As Byte
Dim Poc_Disk As Integer
Dim Disky(26, 5) As String
Set fso = CreateObject("Scripting.FileSystemObject")
'existujici disky
Poc_Disk = 0
For I = 65 To 90
If fso.DriveExists(Chr(I) & ":") = True Then
Poc_Disk = Poc_Disk + 1
Disky(Poc_Disk, 1) = Chr(I) & ":"
End If
Next I
'typ disku
J = 0
For I = 1 To Poc_Disk
xI = fso.GetDrive(Disky(I, 1)).DriveType
Disky(I, 5) = xI
Select Case xI
Case 1
Disky(I, 4) = "Výměnný disk"
If Disky(I, 1) <> "A:" Then
J = 1
End If
Case 2
Disky(I, 4) = "Pevný disk"
Case 3
Disky(I, 4) = "Síťový disk"
Case 4
Disky(I, 4) = "CD - disk"
Case 5
Disky(I, 4) = "RAM - disk"
Case Else
Disky(I, 4) = "Neznámý"
End Select
Next I
If J = 0 Then
'Nenalezen Flash Disc
End If
|