ERFORDERLICHE
OBJEKTE
-- keine --
FORM-CODE
Private Declare Function GetDriveType Lib "Kernel32" Alias _
"GetDriveTypeA" (ByVal nDrive As String) As Long
Function NextFreeDrive()
Dim DriveNum As Integer
Dim FirstFreeDrive As String
Dim FirstDrive As Integer
DriveNum = 1
Do
DriveNum = DriveNum + 1
NextDrive$ = Chr$(DriveNum + 65) + ":\"
FirstDrive% = GetDriveType(NextDrive$)
Loop Until FirstDrive% = 1
'DriveNum: 2=C, 3=D, 4=E u.s.w.
FirstFreeDrive = Chr$(DriveNum + 65) + ":"
NextFreeDrive = FirstFreeDrive
End Function
Private Sub Form_Load()
MsgBox "Nächstes freies Netzlaufwerk: " & NextFreeDrive
End
End Sub
|