Drive Information
Drive Name of a specified file path
Drive is Ready or Not
'Total Number of Drives in your System
Set FSO = CreateObject("Scripting.FileSystemObject")
Set DriveCollection= FSO.Drives 'A collection of drive objects
MsgBox("Total Number of Drives available in your system: "&DriveCollection.Count)
'Drive Information in your System
Set FSO = CreateObject("Scripting.FileSystemObject")
intDrive = 0
For Each Driver in FSO.Drives
Msgbox "Name of the Drive :"&Driver.DriveLetter
Select Case Driver.DriveType
Case 0: strDriveType = "Drive type cannot be determined"
Case 1: strDriveType = "Removable Drive"
Case 2: strDriveType = "Fixed Drive"
Case 3: strDriveType = "CD-ROM"
Case 4: strDriveType = "RAM Disk"
End Select
msgbox "Type of the Drive : "&strDriveType
If(Driver.DriveType = 2)Then
msgbox "Total Size of the Specified Drive: "&Driver.Totalsize
msgbox "Free Space available in the Drive: "&Driver.FreeSpace
msgbox "Available Space in the Drive: "&DriverAvailableSpace
msgbox "File System of the specified Drive: "&Driver.FileSystem
'Available File Systems are FAT, NTFS and CDFS
msgbox "Serial Number of the specified Drive: "&Driver.SerialNumber
msgbox "Share Name of the specified Drive: "&Driver.ShareName
msgbox "Volume Name of the specified Drive: "&Driver.VolumeName
End If
intDrive = intDrive + 1
Next
'Drive Name of a specified file path
DrvPath = "D:\debugnew.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set GetDriveInfo = fso.GetDriveName(drvPath)
Msgbox ("Name of the Drive :"&GetDriveInfo)
'Drive is Ready or Not
DrvPath = "D:\debugnew.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set GetDriveInfo = fso.GetDrive(fso.GetDriveName(drvPath))
If GetDriveInfo.IsReady Then
Msgbox "Drive is Ready"
Else
Msgbox "Drive is Not Ready"
End If
Windows 8, does not detect mapped drives, is there any solution?
ReplyDeleteNice! you are sharing such helpful and easy to understandable blog. i have no words for say i just say thanks because it is helpful for me.
ReplyDeleteDot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
kayseriescortu.com - alacam.org - xescortun.com
ReplyDelete