• Welcome to Jose's Read Only Forum 2023.
 

IFolder.ShortName Property

Started by José Roca, July 14, 2008, 12:35:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

José Roca



The following code illustrates the use of the ShortName property with a File object:

JScript


function ShowShortName(filespec)
{
   var fso, f, s;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   f = fso.GetFile(filespec);
   s = "The short name for " + "" + f.Name;
   s += "" + "<br>";
   s += "is: " + "" + f.ShortName + "";
   return(s);
}


VBScript


Function ShowShortName(filespec)
   Dim fso, f, s
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFile(filespec)
   s = "The short name for "   & UCase(f.Name) & "<BR>"
   s = s & "is: " & f.ShortName
   ShowShortName = s
End Function


PowerBASIC


FUNCTION ShowShortName (BYVAL filespec AS STRING) AS STRING

   LOCAL fso AS IFileSystem
   LOCAL f AS IFile
   LOCAL s AS STRING
   
   fso = NEWCOM "Scripting.FileSystemObject"
   f = fso.GetFile(UCODE$(filespec))
   s = "The short name for "   & ACODE$(f.Name) & $CRLF
   s = s & "is: " & ACODE$(f.ShortName)
   FUNCTION = s

END FUNCTION