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