返回短路徑名,這些短文件名由需要以前的 8.3 文件命名規(guī)范的程序使用。
object.ShortPath
object 應(yīng)為 File 或 Folder 對(duì)象。
下面的代碼通過(guò)一個(gè) File 對(duì)象說(shuō)明了 ShortName 屬性的用法:
[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
Attributes 屬性 | DateCreated 屬性 | DateLastAccessed 屬性 | DateLastModified 屬性 | Drive 屬性 | Files 屬性 | IsRootFolder 屬性 | Name 屬性 | ParentFolder 屬性 | Path 屬性 | ShortName 屬性 | Size 屬性 | SubFolders 屬性 | Type 屬性
應(yīng)用于:File 對(duì)象 | Folder 對(duì)象