manman89

BrowseForFolder - VBS - WSCRIPT

May 1st, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. https://sites.google.com/site/khuvuonxanh
  2.  
  3. Function vBrowseForFolder()
  4. Dim oShell, oFolder
  5.  
  6. Dim BIF_NONEWFOLDERBUTTON
  7. Dim SSFDESKTOP
  8.  
  9. BIF_NONEWFOLDERBUTTON = &H00000200
  10. SSFDESKTOP = &H00
  11.  
  12. Set oShell = CreateObject("Shell.Application")
  13. Set oFolder = oShell.BrowseForFolder(0, "PLEASE SELECT THE DESTINATION FOLDER", BIF_NONEWFOLDERBUTTON, SSFDESKTOP)
  14. If oFolder Is Nothing Then
  15. vBrowseForFolder = ""
  16. Else
  17. vBrowseForFolder = oFolder.self.path
  18. End If
  19. Set oFolder = nothing
  20. Set oShell = nothing
  21. End Function
  22.  
  23. === Example ===
  24.  
  25. Msgbox vBrowseForFolder()
  26.  
  27.  
  28. Have a nice day © ManMan89
Advertisement
Add Comment
Please, Sign In to add comment