企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
| JScript  | [语言参考](#) | |-----|-----| # GetDriveName 方法 根据指定路径返回包含驱动器名称的字符串。 `*object*.GetDriveName(*path*) ` #### 参数 object 必选项。 应为 FileSystemObject 的名称。 path 必选项。 路径说明,将根据其中成分返回驱动器名称。 #### 说明 如果无法确定驱动器,**GetDriveName** 方法将返回长度为零的字符串 ("") 。 **注意  ****GetDriveName** 只作用于所提供的 *path* 字符串。 不会试图解析路径,也不会检查指定的路径是否存在。 下面的例子说明了 **GetDriveName** 方法的用法。 ~~~ function GetDriveLetter(path) { ~~~     ~~~ var fso, s =""; ~~~ ~~~    fso = new ActiveXObject("Scripting.FileSystemObject"); ~~~ ~~~    s += fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(path))); ~~~ ~~~    return(s); ~~~ } #### 请参阅 [GetAbsolutePathName 方法](#) | [GetBaseName 方法](#) | [GetDrive 方法](#) | [GetExtensionName 方法](#) | [GetFile 方法](#) | [GetFileName 方法](#) | [GetFileVersion 方法](#) | [GetFolder 方法](#) | [GetParentFolderName 方法](#) | [GetSpecialFolder 方法](#) | [GetTempName 方法](#)应用于: [FileSystemObject 对象](#) [© 2000 Microsoft Corporation 版权所有。保留所有权利。使用规定。](#)