GetFolderPath 脚本函数
GetFolderPath 函数用于返回 Microsoft Windows SHGetFolderPath 函数的值。此函数用于输入 Microsoft Windows 文件夹的名称,并返回该文件夹的完整路径。
信息注释在标准模式下不支持此函数。请参阅文件系统访问限制。
GetFolderPath(foldername)
| 参数 | 描述 |
|---|---|
| foldername |
Microsoft Windows 文件夹名称。 文件夹名称不得包含任何空格。应从文件夹名称中移除在 Windows Explorer 中看到的文件夹名称所包含的任何空格。 示例: MyMusic MyDocuments |
本示例的目的是获取以下 Microsoft Windows 文件夹的路径:MyMusic、MyPictures 和 Windows。将示例脚本添加到应用程序并重新加载。
LOAD
GetFolderPath('MyMusic') as MyMusic,
GetFolderPath('MyPictures') as MyPictures,
GetFolderPath('Windows') as Windows
AutoGenerate 1;
重新加载应用程序后,字段 MyMusic、MyPictures 和 Windows 已添加到数据模型。每个字段均包含在输入中定义的文件夹路径。例如:
- C:\Users\smu\Music for the folder MyMusic
- C:\Users\smu\Pictures for the folder MyPictures
- C:\Windows for the folder Windows