Initiates a Browse For Folder dialog.
FileSelectFolder ( "dialog text", "root dir" [, flag = 0 [, "initial dir" [, hwnd]]] )
Using a nonexistent root dir will also cause the Desktop folder to be used. Note that DeskTop is the root folder for the entire computer and is not the same as @DesktopDir, which is the current user desktop.
Special Windows folders (such as "My Documents") can be set as root by using the right CLSID detailed in the Appendix.
UNC paths are not supported. If you think that user's may choose files on a UNC path then the path needs to be mapped as a drive first.
The new Vista+ dialog style is used if possible, regardless of the Use New Dialog Style flag. With the Vista dialog style the edit control and create folder buttons are always shown, ignoring the flags parameter, and the dialog text parameter sets the title of the window.
FileOpenDialog, FileSaveDialog
#include <MsgBoxConstants.au3>
Example()
Func Example()
; Create a constant variable in Local scope of the message to display in FileSelectFolder.
Local Const $sMessage= "Select a folder"
; Display an open dialog to select a file.
Local $sFileSelectFolder= FileSelectFolder ($sMessage,"")
If @error Then
; Display the error message.
MsgBox ($MB_SYSTEMMODAL,"","No folder was selected.")
Else
; Display the selected folder.
MsgBox ($MB_SYSTEMMODAL,"","You chose the following folder:"&@CRLF &$sFileSelectFolder)
EndIf
EndFunc ;==>Example