• Welcome to Jose's Read Only Forum 2023.
 

IFileSystem.GetDriveName Method

Started by José Roca, July 14, 2008, 02:43:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following example illustrates the use of the GetDriveName method.

JScript


function GetAName(drivespec)
{
   var fso, s ="";
   fso = new ActiveXObject("Scripting.FileSystemObject");
   s += fso.GetDriveName(drivespec);
   return(s);
}


VBScript


Function GetAName(DriveSpec)
   Dim fso
   Set fso = CreateObject("Scripting.FileSystemObject")
   GetAName = fso.GetDriveName(Drivespec)
End Function


PowerBASIC


FUNCTION GetAName (BYVAL strDriveSpec AS STRING) AS STRING

   LOCAL fso AS IFileSystem

   fso = NEWCOM ("Scripting.FileSystemObject")
   FUNCTION = ACODE$(fso.GetDriveName(strDrivespec))

END FUNCTION