c++ - WinPE 2.0 (Vista) - 使用 VBSCRIPT 和 HTA 应用程序寻找 BrowseForFolder 的解决方案

标签 c++ vbscript hta winpe

我正在创建一个要在 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/

相关文章:

dom - 如何获取HTA窗口的大小?

Javascript wshell.run 无法正常工作

c++ - 使用具有透视图的移动相机时如何避免像素化几何体?

c++ - 为什么排在 char 队列的前面会导致 bad_alloc?

c++ - 从 libcurl 为 HTTP POST 计算 Content-MD5

ms-access - 如何将 MS Access SaveAsText 与查询(特别是存储过程)结合使用

vbscript - 获取系统临时文件夹?

c++ - 如何在 godbolt.org 启用地址清理器

scripting - FileSystemObject - 读取 Unicode 文件

html - HTA - 验证条目