|
Here's my finished code in case anyone has a use for it:
<%@ LANGUAGE = "VBSCRIPT" %> <% Option Explicit %> <% Dim fso, connectedDrives, drv Dim strInfo, driveName Set fso = Server.CreateObject("Scripting.FileSystemObject") Set connectedDrives = fso.drives On Error Resume Next %> <HTML> <HEAD> <TITLE>Drive Information</TITLE> </HEAD> <BODY> <TABLE CELLPADDING="3" CELLSPACING="1" style="border: solid 1px #000000; font-family: Arial; font-size: 10pt;"> <TR BGCOLOR="F5F5F5" style="font-weight: bold;"> <TD style="border: solid 1px #000000;">Drive Letter</TD> <TD style="border: solid 1px #000000;">Drive Type</TD> <TD style="border: solid 1px #000000;">File System</TD> <TD style="border: solid 1px #000000;">Serial Number</TD> <TD style="border: solid 1px #000000;">Name</TD> <TD style="border: solid 1px #000000;">Available Space</TD> <TD style="border: solid 1px #000000;">Total Size</TD> <TD style="border: solid 1px #000000;">Ready/Not Ready</TD> </TR> <% For Each drv In connectedDrives %> <TR> <TD style="border: solid 1px #F5F5F5;"><%=drv.DriveLetter%>: </TD> ; <TD style="border: solid 1px #F5F5F5;"><%=drv.DriveType%> </TD> <TD style="border: solid 1px #F5F5F5;"><%=drv.FileSystem%> </TD> <TD style="border: solid 1px #F5F5F5;"><%=drv.SerialNumber%> </TD> ; <% If drv.DriveType = 3 Then %> <TD style="border: solid 1px #F5F5F5;"><%=drv.ShareName%> </TD> <% Else %> <TD style="border: solid 1px #F5F5F5;"><%=drv.VolumeName%> </TD> <% End If %> <TD style="border: solid 1px #F5F5F5;"><%=drv.AvailableSpace%> </TD& gt; <% If drv.IsReady Then %> <TD style="border: solid 1px #F5F5F5;"><%=drv.TotalSize%> </TD> <TD style="border: solid 1px #F5F5F5;">Ready</TD> <% Else %> <TD style="border: solid 1px #F5F5F5;"> </TD> <TD style="border: solid 1px #F5F5F5;">Not Ready</TD> <% End If %> </TR> <% Next %> </TABLE> <BR> <TABLE CELLPADDING="1" CELLSPACING="1" style="border: solid 1px #000000; font-family: Arial; font-size: 10pt;"> <TR> <TD style="font-weight: bold;">Drive Letter: </TD> <TD>Returns the drive letter of the drive.</TD> </TR> <TR> <TD style="font-weight: bold;">Drive Type: </TD> <TD>Returns the drive type, a numerical value, which can be 0 - Unknown,1 - Removable, 2 - Fixed, 3 - Network, 4 - CD-ROM, 5 - RAM Disk.</TD> </TR> <TR> <TD style="font-weight: bold;">File System: </TD> <TD>Returns the filesystem of the drive, e.g. NTFS,FAT32.</TD> </TR> <TR> <TD style="font-weight: bold;">Serial Number: </TD> <TD>Returns the serial number of the drive.</TD> </TR> <TR> <TD style="font-weight: bold;">Name: </TD> <TD>If the drive is shared on a network, this returns the shared-name of the drive.</TD> </TR> <TR> <TD></TD> <TD>If the drive hasn't been named and is called the default 'Local Disk' then this property returns an empty string.</TD> </TR> <TR> <TD style="font-weight: bold;">Available Space: </TD> <TD>Returns available space left on drive.</TD> </TR> <TR> <TD style="font-weight: bold;">Total Size:</TD> <TD>Returns the total size of the drive.</TD> </TR> <TR> <TD style="font-weight: bold;">Ready / Not Ready</TD> <TD>Returns whether the drive is ready. If the drive is removable such as a floppy drive returns true if there is a disk or media in the drive.</TD> </TR> </TABLE> </BODY> </HTML> <% Set connectedDrives = Nothing Set fso = Nothing %>
|