WinPE 2.0 (Vista) - Looking for a solution for BrowseForFolder using VBSCRIPT & HTA application

StackOverflow https://stackoverflow.com/questions/1922069

  •  20-09-2019
  •  | 
  •  

Question

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.

Was it helpful?

Solution 2

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!

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top