none
Browse for folder in WinPE (MDT 2010) RRS feed

  • Question

  • I have a custom task sequence and I am building HTA GUIs in order to get information from the user.  One piece of the information I'm trying to gather is a folder location via a Browse dialog.  I have tried using the built-in "BrowseForFolder" function in LTIGetFolder.  Using this function works exactly how I want it to - it returns the folder location and puts it in the correct text box I want.  However, in WinPE, the Browse dialog is blank and nothing is selectable.  I've read several articles about this, but could never find a real fix.

    Anyone succesfully used BrowseForFolder in WinPE before?

    Wednesday, April 28, 2010 7:13 PM

All replies

  • Updated 2011-11-20...

    The MDT Deployment Wizard is doing that, but only for the Replace and Refresh scenarios. e.g. when calling the code from running Windows, not WinPE.

    / Johan


    Thursday, April 29, 2010 3:32 AM
    Moderator
  • John -

    Thanks for the info, but that did not fix the problem.  I still get the same blank browse dialog with no folders and/or drives.  It's not that the function doesn't work at all... no errors are reported.  I just cannot see any folders in the dialog.

    Any other clues?

    Monday, May 3, 2010 3:03 PM
  • Was this ever resolved? I have the same issue- the directory tree displays when kicking off the TS from within Windows, but in WinPE there's just a blank area in the dialogue box.

    I modified LTIGetFolder.wsf to this:

    	Function Main
    		oLogging.CreateEntry "---------------- Initialization ----------------", LogTypeInfo
    		Dim oFolder, i, networkFolder
    		
    		i = InStrRev(oEnvironment.Item("DeployRoot"),"\")
    		networkFolder = Left(oEnvironment.Item("DeployRoot"),i) & "USMT"
    		
    		Set oFolder = nothing
    		on error resume next
    		Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Select the COMPUTER NAME", &H200, networkFolder)
    		on error goto 0
    		
    		If oFolder is nothing then
    			oEnvironment.Item("FolderPath") = oEnvironment.Item("DefaultFolderPath")
    		Else
    			oEnvironment.Item("FolderPath") = oFolder.self.Path
    		End if 
    
    		Main = Success
    	End Function
    


    So, when the users picks the "browse" button to restore user's data, it goes right to the directory where the MIG files are saved.

    Wednesday, October 26, 2011 11:03 PM
  • Bump.  Anyone?
    Tuesday, November 1, 2011 2:45 PM
  • Followup...

    The code snippet will only work in Windows, since WinPE are missing some of the components required.

    One solution is to use an AutoIT script in WinPE.  AutoIT has a browse for folder feature you can use.

    / Johan


    Regards / Johan Arwidmark Twitter: @jarwidmark Blog: http://www.deploymentresearch.com FB: www.facebook.com/deploymentresearch
    Sunday, November 20, 2011 1:59 PM
    Moderator