'Open File' dialog by VBS
来源:互联网 发布:360度全景软件 编辑:程序博客网 时间:2024/06/04 20:02
Function BrowseForFile() Dim shell : Set shell = CreateObject("WScript.Shell") Dim fso : Set fso = CreateObject("Scripting.FileSystemObject") Dim tempFolder : Set tempFolder = fso.GetSpecialFolder(2) Dim tempName : tempName = fso.GetTempName() Dim tempFile : Set tempFile = tempFolder.CreateTextFile(tempName & ".hta") tempFile.Write _ "<html>" & _ "<head>" & _ "<title>Browse</title>" & _ "</head>" & _ "<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>" & _ "</html>" 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'Author: Demon'Website: http://demon.tw'Date: 2011/6/2path = BrowseForFile()If path <> "" Then WScript.Echo path
Refer to: http://demon.tw/programming/vbs-open-file-dialog.html
- 'Open File' dialog by VBS
- How to Open "File And Replace" Dialog Box ?
- 【转】WTL-Open file dialog of new vista/win7 style
- [Linker Error] Unable to open file 'DIALOG.RES'
- How to open the dialog out of iframe by using jquery dialog
- VBS---File对象
- VBS 改 IP(modify IP by VBS)
- VBS 改 IP(modify IP by VBS)
- File#open
- file open
- How to Customize Common Open File Dialog Box Places Bar in Windows
- art.dialog.open用法
- art.dialog.open用法
- open/close sharepoint dialog
- eclipse open preference dialog
- get files version by vbs
- VBS获取天气预报[BY Broly]
- Caused by: android.database.sqlite.SQLiteException: unable to open database file
- 易语言编程步骤
- Android视图组件: CheckBox
- REST会是SOA的未来吗?带领大家一起探索!
- 网桥路由器有什么区别
- 【代码】Android 退出 App 方法的完美解决
- 'Open File' dialog by VBS
- Android HAL 开发 (5)
- 人脸识别主要算法原理
- dtree编写简单的树形菜单组件
- Lie to Me: Bypassing Modern Web Application Firewalls
- Funny Game
- [LeetCode] Print All Combinations of a Number as a Sum of Candidate Numbers
- sql提供的1433端口或者动态端口问题
- CXF之Features