Sub ドライブ準備()
    Dim FSO As New FileSystemObject
    Dim myDrive As Drive
    Const strDrive = "F"
    
    Set myDrive = FSO.GetDrive(strDrive)
    
    If Not myDrive.IsReady Then
        MsgBox "Dドライブの準備が出来ていません", vbExclamation, "ドライブ準備"
    End If
    
    Select Case myDrive.DriveType
    
        Case 0
            MsgBox "不明"
        
        Case 1
            MsgBox "リムーマブルディスク"
        
        Case 2
            MsgBox "ハードディスク"
        
        Case 3
            MsgBox "ネットワークディスク"
        
        Case 4
            MsgBox "CD-ROM"
        
        Case 5
            MsgBox "RAM ディクス"
    
    End Select
    
    Set FSO = Nothing
End Sub


パス Path
タイプ DriveType
ドライブ名 DriveLetter
総容量 TotalSize
空容量 FreeSpace
準備 IsReady


 ↓ facebook のフォローで応援してください。お願いします。



Microsoft Office ブログランキングへ