Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server Drive List

Status
Not open for further replies.

Hpatel

IS-IT--Management
Apr 3, 2001
21
US
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")
End If
End With
Set fsoDrive = Nothing
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top