The first type:
FunctionBrowseforfile ()
DimShell:SetShell =CreateObject("Wscript.Shell")
DimFso:SetFSO =CreateObject("Scripting.FileSystemObject")
DimTempFolder:SetTempFolder = fso. GetSpecialFolder (2)
DimTempname:tempname = fso. GetTempName ()
DimTempfile:SetTempfile = Tempfolder.createtextfile (Tempname &". HTA")
Tempfile.write _
"""<title>Browse</title>""& _
"<body>"& _
"<input type= ' file ' id= ' F '/>"& _
"<script type= ' Text/javascript ' >"& _
"var f = document.getElementById (' f ');"& _
"F.click ();"& _
"var shell = new ActiveXObject (' Wscript.Shell ');"& _
"Shell. RegWrite (' Hkey_current_user\\volatile environment\\msgresp ', f.value); "& _
"Window.close ();"& _
"</script>"& _
"</body>"& _
"
Tempfile.close
Shell. Run TempFolder &"\"& Tempname &". HTA",0,True
Browseforfile = Shell. RegRead ("Hkey_current_user\volatile Environment\msgresp")
Shell. RegDelete"Hkey_current_user\volatile Environment\msgresp"
End Function
MsgBoxBrowseforfile ()
The second type:
DimOshell
SetOshell =CreateObject("Shell.Application")
Oshell.minimizeall' Minimize All windows
Oshell.findfiles' Open File Search window
Oshell.explore"F:\" ' I browse folders
Oshell.browseforfolder0,"Please select a folder for the program", 0x1000|0x0001,0x0000
The third type:
SetOIE =CreateObject("Internetexplorer.application")
Oie.navigate"About:blank"
OIE.Document.Write"<input type= ' file ' id= ' x '/>"
SetOelement = OIE.Document.getElementById ("x")
Oelement.click
WScript.Echo Oelement.value
Oie.quit
Win7,xp common ways to open a file-browsing dialog box