This little code [gs snippet] will let you to let an end-user to select a folder to pass to the logic to let your script to decide, for example, how to behave or what to do (decided by the programmer, obviously).
On error resume next
SET fso=createobject("scripting.filesystemobject")
SET WshShell=WScript.CreateObject("Shell.Application")
dirPath=WshShell.BrowseForFolder(0, "Select the path", &H4000, "").items().item().path
IF right(dirPath,1)<>"\" THEN
dirPath=dirpath & "\"
END IF
IF dirpath="\" THEN
dirpath="You have to select a folder!"
END IF
msgbox dirpath
NOTE: this [gs script] use the BrowseForFolder [gs method].
SOURCE | LINK | LANGUAGE | ENGLISH |
Hey dude, did you know? Let user select a folder from script (Visual Basic) – http://heelpbook.altervista.org/?p=35168 (Visit us on http://www.heelpbook.net) – Enjoy!
Let user select a folder from script (Visual Basic) http://heelpbook.altervista.org/2012/let-user-select-a-folder-from-script-visual-basic/ via @HeelpBook