我有以下脚本,我使用wscript
启动:
Set sh = CreateObject("Shell.Application")
Set rv = sh.BrowseForFolder(0, "Now browse...", 1)
WScript.Echo rv
如何获取所选文件夹的完整路径?
Folder
返回的BrowseForFolder
对象的文档没有任何内容。
或许我应该使用完全不同的东西来浏览wscript
...
答案 0 :(得分:2)
rv.Self.Path
,在此详细讨论:How Can I Show Users a Dialog Box That Only Lets Them Select Folders?在嘿,脚本专家!博客
Set sh = CreateObject("Shell.Application")
Set rv = sh.BrowseForFolder(0, "Now browse...", 1)
If rv Is Nothing Then
WScript.Echo "Nothing chosen"
Else
WScript.Echo rv.Self.Path
End If