View Full Version : 'browse' button for vbscript (W2K)
Does vbscript have a command that will create a 'browse' button for a user to browse for drives/folders/files?
Use this vbscript to launch the standard Browse For Folder dialog
Limitations: you can not select files.
'############### Browse For Folder dialog ################
On Error Resume Next
Const BIF_EDITBOX = &H10
Const BIF_NEWDIALOGSTYLE = &H40
Set sa = CreateObject("Shell.Application")
Set oF = sa.BrowseForFolder(0, "My Computer:",_
BIF_EDITBOX Or BIF_NEWDIALOGSTYLE)
oFolder = oF.Items.Item.path
If Err.Number > 0 Then
MsgBox("You have not selected a folder." & vbCrlf &_
"This script will not continue!")
Err.Clear
Else
wscript.echo oFolder
End If
'###################### End #############################
Jama
Powered by vBulletin™ Version 4.1.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.