The following example illustrates the use of the
GetParentFolderName method.
JScript
function GetTheParent(drivespec)
{
var fso, s = "";
fso = new ActiveXObject("Scripting.FileSystemObject");
s += fso.GetParentFolderName(drivespec);
return(s);
}
VBScript
Function GetTheParent(DriveSpec)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
GetTheParent = fso.GetParentFolderName(Drivespec)
End Function
PowerBASIC
FUNCTION GetTheParent (BYVAL strDriveSpec AS STRING) AS STRING
LOCAL fso AS IFileSystem
fso = NEWCOM ("Scripting.FileSystemObject")
FUNCTION = ACODE$(fso.GetParentFolderName(UCODE$(strDriveSpec)))
END FUNCTION