(view source code of getfoldr.vbs as plain text)
Option ExplicitDim strPathstrPath = SelectFolder( "" )
If strPath = vbNull Then
WScript.Echo "Cancelled"
ElseWScript.Echo "Selected Folder: """ & strPath & """"
End If
Function SelectFolder( myStartFolder )
' This function opens a "Select Folder" dialog and will' return the fully qualified path of the selected folder'' Argument:' myStartFolder [string] the root folder where you can start browsing;' if an empty string is used, browsing starts' on the local computer'' Returns:' A string containing the fully qualified path of the selected folder'' Written by Rob van der Woude' http://www.robvanderwoude.com ' Standard housekeeping Dim objFolder, objItem, objShell ' Custom error handlingOn Error Resume Next
SelectFolder = vbNull ' Create a dialog objectSet objShell = CreateObject( "Shell.Application" )
Set objFolder = objShell.BrowseForFolder( 0, "Select Folder", 0, myStartFolder )
' Return the path of the selected folderIf IsObject( objfolder ) Then SelectFolder = objFolder.Self.Path
' Standard housekeepingSet objFolder = Nothing
Set objshell = Nothing
On Error Goto 0
End Function
page last modified: 2025-10-11; loaded in 0.0072 seconds