.BrowseForFolder
Prompt the user to select a folder.
Syntax
.BrowseForFolder(WINDOW_HANDLE, "Window Title", WINDOW_OPTIONS, StartPath)
Key
WINDOW_HANDLE This should always be 0
WINDOW_OPTIONS
0 = Folders only
16384 = Browse all files
StartPath A drive/folder path or one of the following numeric constants:
DESKTOP = 0
PROGRAMS = 2
DRIVES = 17
NETWORK = 18
NETHOOD = 19
PROGRAMFILES = 38
PROGRAMFILESx86 = 48
WINDOWS = 36
Although you can display files with .BrowseForFolder, the method will only return a folder.
Example
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.BrowseForFolder(0, "Example", 1, "c:\Programs")
If objFolder Is Nothing Then
Wscript.Quit
End If
wscript.Echo "folder: " & objFolder.title & " Path: " & objFolder.self.path