AngloTom Posted May 4, 2010 Share Posted May 4, 2010 (edited) Here's the script: browseFolder() Func browseFolder() $var = FileSelectFolder("Choose a folder.", "") $txtLoc = @ScriptDir & "\txtFolderLoc.txt" $file = FileOpen($txtLoc, 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $var) FileClose($file) EndFunc When compiled and ran in WinPE, nothing happens. No error dialogs, not even a process is visible in Task Manager. The return code, however, is 0. Any ideas why this won't work in WinPE? ~AngloTom Edited May 4, 2010 by AngloTom Link to comment Share on other sites More sharing options...
AngloTom Posted May 4, 2010 Author Share Posted May 4, 2010 Here's the script: browseFolder() Func browseFolder() $var = FileSelectFolder("Choose a folder.", "") $txtLoc = @ScriptDir & "\txtFolderLoc.txt" $file = FileOpen($txtLoc, 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWrite($file, $var) FileClose($file) EndFunc When compiled and ran in WinPE, nothing happens. No error dialogs, not even a process is visible in Task Manager. The return code, however, is 0. Any ideas why this won't work in WinPE? ~AngloTom Ok so I simplified the script to: $var = FileSelectFolder("Choose a folder.", "") ... compiled it to an exe, and it still doesn't work in WinPE. Nothing happens... no error screen anything. Any ideas? Should I use dependency walker on it and include any missing DLLs in my WinPE image? Link to comment Share on other sites More sharing options...
AngloTom Posted May 4, 2010 Author Share Posted May 4, 2010 Ok so I read this thread: http://www.autoitscript.com/forum/index.php?showtopic=3040&hl=FileSelectFolder%20WinPE&st=0 ... and decided to use the FileSaveDialog function instead. Link to comment Share on other sites More sharing options...
JFX Posted May 5, 2010 Share Posted May 5, 2010 Any ideas why this won't work in WinPE? With WinPE i assume you use WinPE 2 (Vista) or WinPE 3 (Seven)? If so, you just missing the Desktop folder. One solution create this folder before you use FileSelectFolder If Not FileExists(@UserProfileDir & '\Desktop') Then DirCreate(@UserProfileDir & '\Desktop') Other way is to show the My Computer in the root of the folder tree $var = FileSelectFolder("Choose a folder.", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") Link to comment Share on other sites More sharing options...
AngloTom Posted May 5, 2010 Author Share Posted May 5, 2010 With WinPE i assume you use WinPE 2 (Vista) or WinPE 3 (Seven)? If so, you just missing the Desktop folder. One solution create this folder before you use FileSelectFolder If Not FileExists(@UserProfileDir & '\Desktop') Then DirCreate(@UserProfileDir & '\Desktop') Other way is to show the My Computer in the root of the folder tree $var = FileSelectFolder("Choose a folder.", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") Awesome, I will give that a shot. Thanks for the info. Link to comment Share on other sites More sharing options...
Zhagas Posted May 10, 2010 Share Posted May 10, 2010 Does anyone else have any other suggestions or ideas? I have tried the two suggestions listed above and neither seem to fix the empty browse window for me. I verified the specified profile folder is being created in WinPE and that the browse window does start on "my computer" on a windows 7 box (I am unable to tell on WinPE since it the browse windows doesn't populate.) I am using WinPE 3. Any ideas would be greatly appreciated... I've been tearing my hair out about this for a couple weeks now and was about to break down and write my own save dialog in HTA but would prefer to avoid that if possible. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now