我正在创建一个要在 WinPE 2.0 环境中运行的 HTA 应用程序。
此 HTA 应用程序的目的是提示用户选择备份位置。我目前正在使用 BrowseForFolder 来提示用户文件夹位置。脚本在 Vista 中运行良好。
但是,这在 winpe 2.0 中不起作用 - 并且会出现一个没有文件夹可供选择的对话框。
这是我的代码,第 61-75 行:http://pastie.org/747122
Sub ChooseSaveFolder
strStartDir = ""
userselections.txtFile.value = PickFolder(strStartDir)
End Sub
Function PickFolder(strStartDir)
Dim SA, F
Set SA = CreateObject("Shell.Application")
Set F = SA.BrowseForFolder(0, "Please choose a location to backup your system to. A .tbi file will be created here.", 0, strStartDir)
If (Not F Is Nothing) Then
PickFolder = F.Items.Item.path
End If
Set F = Nothing
Set SA = Nothing
End Function
尝试失败的解决方案:
1) 添加目录X:\Windows\System32\config\systemprofile\Desktop
是否有人为 winpe 2.0 创建了任何高级 HTA 应用程序?我正在寻找这个问题的解决方案,或者可能是一些 C++ 代码可以帮助我完成类似的任务。
最佳答案
Google 快速搜索发现:http://www.911cd.net/forums//index.php?showtopic=21269
确保 WinPE 文件系统中存在以下目录:X:\Windows\System32\config\systemprofile\Desktop
关于c++ - WinPE 2.0 (Vista) - 使用 VBSCRIPT 和 HTA 应用程序寻找 BrowseForFolder 的解决方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1922069/