I need help with finding what different drives as in different SERVERs. I am currently working with eight servers and i need to find out their different drives. I have code for fileSystemObject but it gives me information for my Computer drives. I am posting the code below and see if you can modify it or have another solution to my problem. thank you,
Hpatel
Option Explicit
Dim fso As New FileSystemObject
Dim fsoDrives As Drives
Dim fsoDrive As Drive
Private Sub Form_Load()
Label1.AutoSize = True
Command1.Caption = "List All Drives"
Combo1.Enabled = False
End Sub
Private Sub Command1_Click()
Dim sDrive As String
Dim sDriveType As String
Set fsoDrives = fso.Drives
Combo1.Enabled = True
For Each fsoDrive In fsoDrives
sDrive = "Drive " & fsoDrive.DriveLetter & ": "
Select Case fsoDrive.DriveType
Case 0: sDriveType = "Unknown"
Case 1: sDriveType = "Removable Drive"
Case 2: sDriveType = "Fixed Disk"
Case 3: sDriveType = "Remote Disk"
Case 4: sDriveType = "CDROM Drive"
Case 5: sDriveType = "RAM Disk"
End Select
sDrive = sDrive & sDriveType
Combo1.AddItem (sDrive)
Next
Set fsoDrives = Nothing
End Sub
Private Sub Combo1_Click()
Dim sDriveSpec As String
Dim sSelDrive As String
Dim RemotePath As String
sSelDrive = Combo1.List(Combo1.ListIndex)
sSelDrive = Mid(sSelDrive, 7, 1)
Set fsoDrive = fso.GetDrive(sSelDrive)
With fsoDrive
If .IsReady = True Then
sDriveSpec = "Drive " & .DriveLetter & _
" Specifications" & vbLf
sDriveSpec = sDriveSpec & "Remote Disk Path" & _
RemotePath & vbLf
sDriveSpec = sDriveSpec & "File System: " & _
.FileSystem & vbLf
sDriveSpec = sDriveSpec & "Serial Number: " & _
.SerialNumber & vbLf
sDriveSpec = sDriveSpec & "Volume Name: " & _
.VolumeName
Label1.Caption = sDriveSpec
Else
MsgBox ("Drive Not Ready"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
End If
End With
Set fsoDrive = Nothing
End Sub
Hpatel
Option Explicit
Dim fso As New FileSystemObject
Dim fsoDrives As Drives
Dim fsoDrive As Drive
Private Sub Form_Load()
Label1.AutoSize = True
Command1.Caption = "List All Drives"
Combo1.Enabled = False
End Sub
Private Sub Command1_Click()
Dim sDrive As String
Dim sDriveType As String
Set fsoDrives = fso.Drives
Combo1.Enabled = True
For Each fsoDrive In fsoDrives
sDrive = "Drive " & fsoDrive.DriveLetter & ": "
Select Case fsoDrive.DriveType
Case 0: sDriveType = "Unknown"
Case 1: sDriveType = "Removable Drive"
Case 2: sDriveType = "Fixed Disk"
Case 3: sDriveType = "Remote Disk"
Case 4: sDriveType = "CDROM Drive"
Case 5: sDriveType = "RAM Disk"
End Select
sDrive = sDrive & sDriveType
Combo1.AddItem (sDrive)
Next
Set fsoDrives = Nothing
End Sub
Private Sub Combo1_Click()
Dim sDriveSpec As String
Dim sSelDrive As String
Dim RemotePath As String
sSelDrive = Combo1.List(Combo1.ListIndex)
sSelDrive = Mid(sSelDrive, 7, 1)
Set fsoDrive = fso.GetDrive(sSelDrive)
With fsoDrive
If .IsReady = True Then
sDriveSpec = "Drive " & .DriveLetter & _
" Specifications" & vbLf
sDriveSpec = sDriveSpec & "Remote Disk Path" & _
RemotePath & vbLf
sDriveSpec = sDriveSpec & "File System: " & _
.FileSystem & vbLf
sDriveSpec = sDriveSpec & "Serial Number: " & _
.SerialNumber & vbLf
sDriveSpec = sDriveSpec & "Volume Name: " & _
.VolumeName
Label1.Caption = sDriveSpec
Else
MsgBox ("Drive Not Ready"
End If
End With
Set fsoDrive = Nothing
End Sub