ShortPath プロパティ

従来の 8.3 形式のファイル名が必要なプログラムのために、短いパス名を返します。

object.ShortPath 

object には、File オブジェクトまたは Folder オブジェクトの名前を指定します。

解説

次のコードは、File オブジェクトの ShortName プロパティの使用例です。

function ShowShortPath(filespec)
{
   var fso, f, s;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   f = fso.GetFile(filespec);
   s = "パス名 : " + "" + f.Name;
   s += "" + "<BR>";
   s += "短いパス名 : " + "" + f.ShortPath + "";
   return(s);
}
[VBScript]
Function ShowShortName(filespec)
   Dim fso, f, s
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.GetFile(filespec)
   s = "パス名 : " & "" & UCase(f.Name) & "" & "<BR>"
   s = s & "短いパス名 : " & f.ShortName 
   ShowShortName = s
End Function

参照

Attributes プロパティ | DateCreated プロパティ | DateLastAccessed プロパティ | DateLastModified プロパティ | Drive プロパティ | Files プロパティ | IsRootFolder プロパティ | Name プロパティ | ParentFolder プロパティ | Path プロパティ | ShortName プロパティ | Size プロパティ | SubFolders プロパティ | Type プロパティ

対象: File オブジェクト | Folder オブジェクト