1

我正在创建一个在 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++ 代码。

4

2 回答 2

1

快速谷歌搜索发现:http ://www.911cd.net/forums//index.php?showtopic=21269

确保 WinPE 文件系统中存在以下目录:X:\Windows\System32\config\systemprofile\Desktop

于 2009-12-17T18:02:03.680 回答
1

经过数周和数周...我找到(并测试了)使用 Autoit 的解决方案,请在此处下载:http ://www.autoitscript.com/autoit3/

Autoit 将允许您使用其“为自动化 Windows GUI 和通用脚本而设计的类似 BASIC 的脚本语言”创建一个独立的可执行 BrowseForFolder 对话框

通过这样做,对话框不依赖于任何其他 windows 文件,并且可以在 WinPE 2.0 中运行

Autoit 也可能是您其他 WinPE 2.0 dll 依赖问题的解决方案。

享受!

于 2009-12-28T17:12:45.847 回答