The following example illustrates the use of the
RootFolder property:
JScriptfunction GetRootFolder(drv)
{
var fso,d;
fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso.DriveExists(drv))
{
d = fso.GetDrive(drv);
return(d.RootFolder);
}
else
return(false);
}
VBScriptFunction GetRootFolder(drvspec)
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetDrive(drvspec)
GetRootFolder = f.RootFolder
End Function
PowerBASICFUNCTION GetRootFolder (BYVAL drvspec AS STRING) AS STRING
LOCAL fso AS IFileSystem
LOCAL f AS IFile
fso = NEWCOM ("Scripting.FileSystemObject")
f = fso.GetDrive(UCODE$(drvspec))
FUNCTION = ACODE$(f.RootFolder)
END FUNCTION