Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim strPath
- strPath = SelectFolder( "Desktop" )
- If strPath = vbNull Then
- WScript.Echo "Canceled"
- Else
- WScript.Echo """" & strPath & """"
- End If
- Function SelectFolder( myStartFolder )
- Dim objFolder, objItem, objShell,Message
- On Error Resume Next
- SelectFolder = vbNull
- Set objShell = CreateObject( "Shell.Application" )
- Message = "Folder:"
- Set objFolder = objShell.BrowseForFolder( 0,Message, &H0211, myStartFolder )
- If IsObject( objfolder ) Then SelectFolder = objFolder.Self.Path
- Set objFolder = Nothing
- Set objshell = Nothing
- On Error Goto 0
- End Function
Advertisement
Add Comment
Please, Sign In to add comment