0 Members and 1 Guest are viewing this topic.
function ShowAvailableSpace(drvPath){ var fso, d, s; fso = new ActiveXObject("Scripting.FileSystemObject"); d = fso.GetDrive(fso.GetDriveName(drvPath)); s = "Drive " + drvPath.toUpperCase() + " - "; s += d.VolumeName + "<br>"; s += "Available Space: " + d.AvailableSpace/1024 + " Kbytes"; return(s);}
Function ShowAvailableSpace(drvPath) Dim fso, d, s Set fso = CreateObject("Scripting.FileSystemObject") Set d = fso.GetDrive(fso.GetDriveName(drvPath)) s = "Drive " & UCase(drvPath) & " - " s = s & d.VolumeName & "<BR>" s = s & "Available Space: " & FormatNumber(d.AvailableSpace/1024, 0) s = s & " Kbytes" ShowAvailableSpace = sEnd Function
FUNCTION ShowAvailableSpace (BYVAL drvPath AS STRING) AS STRING LOCAL fso AS IFileSystem LOCAL d AS IDrive LOCAL s AS STRING LOCAL v AS VARIANT fso = NEWCOM "Scripting.FileSystemObject" d = fso.GetDrive(fso.GetDriveName(UCODE$(drvPath))) s = "Drive " & UCASE$(drvPath) & " - " s = d & ACODE$(d.VolumeName) & CRLF v = d.AvailableSpace s = s & "Available Space: " & FORMAT$(VARIANT#(v) / 1024) s = s & " Kbytes" FUNCTION = sEND FUNCTION