根據提供的路徑說明返回明確完整的路徑。
object.GetAbsolutePathName(pathspec)
如果路徑提供了從指定驅動器的根開始的完整的引用,那么它就是明確和完整的。如果路徑指定的是映射驅動器的根文件夾,那么完整的路徑將只能由一個路徑分隔符 (\) 結束。
假設當前目錄是 c:\mydocuments\reports ,下表說明了 GetAbsolutePathName 方法的操作。
pathspec | 返回的路徑 |
---|---|
"c:" | "c:\mydocuments\reports" |
"c:.." | "c:\mydocuments" |
"c:\\" | "c:\" |
"c:*.*\\may97" | "c:\mydocuments\reports\*.*\may97" |
"region1" | "c:\mydocuments\reports\region1" |
"c:\\..\\..\\mydocuments" | "c:\mydocuments" |
下面的例子說明了 GetAbsolutePathName 方法的用法。
function ShowAbsolutePath(path) { var fso, s= ""; fso = new ActiveXObject("Scripting.FileSystemObject"); s += fso.GetAbsolutePathName(path); return(s); }
GetBaseName 方法 | GetDrive 方法 | GetDriveName 方法 | GetExtensionName 方法 | GetFile 方法 | GetFileName 方法 | GetFlieVersion 方法 | GetFolder 方法 | GetParentFolderName 方法 | GetSpecialFolder 方法 | GetTempName 方法
應用于:FileSystemObject 對象