Mit einer API geht das
Declare Function GetVolumeInformation& Lib "kernel32" _
Alias "GetVolumeInformationA" (Byval lpRootPathName _
As String, Byval pVolumeNameBuffer As String, Byval _
nVolumeNameSize As Long, lpVolumeSerialNumber As Long, _
lpMaximumComponentLength As Long, lpFileSystemFlags As _
Long, Byval lpFileSystemNameBuffer As String, Byval _
nFileSystemNameSize As Long)
Const MAX_FILENAME_LEN = 256
Function IsDriveReady(Drive$) As Variant
IsDriveReady = False
Dim No&, s As String * MAX_FILENAME_LEN
Call GetVolumeInformation(Drive & ":\", s, MAX_FILENAME_LEN, _
No, 0&, 0&, s, MAX_FILENAME_LEN)
If No& <>0 Then
IsDriveReady = True
End If
End Function
Sub Click(Source As Button)
Msgbox IsDriveReady ("E")
End Sub
und wer es lieber pur liebt, hier ein quick hack in script
Function IsDriveReady ( drive As String ) As Variant
IsDriveReady = True
On Error Goto errHandle
Chdrive drive
Exit Function
errHandle:
IsDriveReady = False
Resume Next
End Function
eknori