views:

421

answers:

2

Hi,

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.

A: 

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

Luke
Hi Luke,Thanks for the response - however I have already tried that solution. The problem still exists after adding the directory.Thanks
megapixel
You could try running Process Monitor on the WinPE system and see if it is trying to read non-existent files or registry keys. I am actually working on a side project based on WinPE so maybe I will take a look at this tonight.
Luke
Great Idea Luke. I will see what I can find with Process Monitor. Thanks.
megapixel
+1  A: 

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!

megapixel
AutoIt is really the best for WinPE. I've used it multiple times and it proves very useful.
MadBoy