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

发布于 2024-08-15 04:09:31 字数 939 浏览 7 评论 0原文

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

I am creating an HTA application to be run inside of a WinPE 2.0 environment.

The purpose of this HTA app is to prompt the user to select a back-up location. I am currently using BrowseForFolder to prompt the user folder location. Script works fine in Vista.

However, this does not work in winpe 2.0 - and a dialog appears with no folders to select.

Here is my code, lines 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

Failed Attempted Solutions:

1) Adding the directory X:\Windows\System32\config\systemprofile\Desktop

Has anyone created any advanced HTA apps for winpe 2.0? I am looking for a solution to this problem, or possibly some c++ code that can put me on my way to accomplish a similar task.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

杀お生予夺 2024-08-22 04:09:31

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

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

A quick Google search found this: http://www.911cd.net/forums//index.php?showtopic=21269

Make sure the following directory exists in the WinPE file system: X:\Windows\System32\config\systemprofile\Desktop

策马西风 2024-08-22 04:09:31

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

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

。依赖于任何其他 Windows 文件,并且可以在 WinPE 2.0 中运行

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

享受!

After weeks and weeks... I have found (and tested) a solution using Autoit, download here: http://www.autoitscript.com/autoit3/

Autoit will allow you to create a standalone executable BrowseForFolder dialog using their "BASIC-like scripting language designed for automating the Windows GUI and general scripting"

By doing this, the dialog is not dependent on any other windows files, and can be run in WinPE 2.0

Autoit may also be a solution to your other WinPE 2.0 dll dependency issues.

Enjoy!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文