25 lines
777 B
Plaintext
25 lines
777 B
Plaintext
|
<%
|
||
|
'declare our variables
|
||
|
Dim objFSO , objDrive , drive
|
||
|
'create an instance of FileSystemObject
|
||
|
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
|
||
|
Set objDrive = objFSO.Drives
|
||
|
'loop through every drive that is present
|
||
|
For Each drive in objDrive
|
||
|
'if the drive is ready then execute the following
|
||
|
If drive.IsReady Then
|
||
|
Response.Write drive.DriveLetter & "<br>"
|
||
|
Response.Write drive.Path & "<br>"
|
||
|
Response.Write drive.FileSystem & "<br>"
|
||
|
Response.Write drive.TotalSize & "<br>"
|
||
|
Response.Write drive.FreeSpace & "<br>"
|
||
|
'if the drive is not ready execute the following
|
||
|
Else
|
||
|
Response.Write drive.DriveLetter & "<br>"
|
||
|
Response.Write "is unavailable"
|
||
|
End If
|
||
|
Next
|
||
|
destroy objects
|
||
|
Set objDrive = Nothing
|
||
|
Set objFSO = Nothing
|
||
|
%>
|