VBScript Scripting Techniques: File Open Dialog http://www.robvanderwoude.com/vbstech_ui_fileopen.php
This website uses cookies to ensure you get the best experience on our website More info

VBScript Scripting Techniques > User Interaction > File Open Dialog
File Open Dialog
| UserAccounts.CommonDialog | |
|---|---|
| VBScript Code: | |
| WScript.Echo "Selected file: " & GetFileName( "C:\", "" ) WScript.Echo "Selected file: " & GetFileName( "", "Text files|*.txt" ) WScript.Echo "Selected file: " & GetFileName( "", "MS Office documents|*.doc;*.xls;*.pps" ) WScript.Echo "Selected file: " & GetFileName( "C:\WINDOWS", "Bitmaps|*.bmp" ) Function GetFileName( myDir, myFilter ) ' Standard housekeeping ' Create a dialog object ' Check arguments and use defaults when necessary ' Open the dialog and return the selected file name |
|
| Requirements: | |
| Windows version: | Windows XP |
| Network: | N/A |
| Client software: | N/A |
| Script Engine: | any (WSH if using default for directory) |
| Additional options: | objDialog.Filter = "MS Office files|*.doc;*.xls;*.pps|Text files|*.txt|All files|*.*" |
| Summarized: | Works in Windows XP only. If used in HTAs, the initial directory must be specified. Doesn't work in any other Windows version. |
![]() |
|
| [Back to the top of this page] | |
| SAFRCFileDlg.FileOpen | |
| VBScript Code: | |
| Set objDialog = CreateObject( "SAFRCFileDlg.FileOpen" )
' Note: The dialog will be opened without any file name or |
|
| Requirements: | |
| Windows version: | Windows XP, Server 2003 |
| Network: | N/A |
| Client software: | N/A |
| Script Engine: | any |
| Summarized: | Works in all Windows XP versions and in Server 2003. Doesn't work in Windows 95, 98, ME, NT 4, 2000 or 7, not sure about Vista. |
![]() |
|
| [Back to the top of this page] | |
| InternetExplorer.Application | |
| VBScript Code: | |
| Option Explicit
WScript.Echo "Selected file: " & ChooseFile( ) Function ChooseFile( ) |
|
| Requirements: | |
| Windows version: | any |
| Network: | N/A |
| Client software: | Internet Explorer |
| Script Engine: | any |
| Summarized: | Works in all Windows versions. |
![]() |
|
| [Back to the top of this page] | |
| WScript.Shell.Exec MSHTA | |
| VBScript Code: | |
| Option Explicit
Dim strFile strFile = SelectFile( ) If strFile = "" Then Function SelectFile( ) Dim objExec, strMSHTA, wshShell SelectFile = "" ' For use in HTAs as well as "plain" VBScript: Set wshShell = CreateObject( "WScript.Shell" ) SelectFile = objExec.StdOut.ReadLine( ) Set objExec = Nothing |
|
| Requirements: | |
| Windows version: | Windows XP and later versions |
| Network: | N/A |
| Client software: | MSHTA.EXE (native in Windows) |
| Script Engine: | any |
| Summarized: | Works in Windows XP, Vista, Windows 7, Windows 8, Windows 8.1. |
![]() |
|
| [Back to the top of this page] | |
| page last uploaded: 2016-09-19, 14:58 |
VBScript Scripting Techniques: File Open Dialog http://www.robvanderwoude.com/vbstech_ui_fileopen.php的更多相关文章
- VC++ chap12 file
file operation _______C语言对文件操作的支持 fopen accepts paths that are valid on the file system at the point ...
- ux.plup.File plupload 集成 ux.plup.FileLis 批量上传预览
//plupload 集成 Ext.define('ux.plup.File', { extend: 'Ext.form.field.Text', xtype: 'plupFile', alias: ...
- html 5 drag and drop upload file
compatible: chrome firefox ie 11 , not supported demo: http://demo.tutorialzine.com/2011/09/html5-fi ...
- InstallShield 创建自己的Dialog
1.在"User Interface"-"Dialogs"下,在All Dialogs右击"New Dialogs-"创建自己的Dialog ...
- Test Scenarios for image upload functionality (also applicable for other file upload functionality)
1 check for uploaded image path2 check image upload and change functionality3 check image upload fun ...
- RoR unobtrusive scripting adapter--UJS(一些Javascript的语法糖)
Learn how the new Rails UJS library works and compares with the old version of jquery_ujs that it re ...
- [javaSE] GUI(对话框Dialog)
对话框不能单独存在,依赖于窗体,有显示标题,有模式 获取Dialog对象,new出来,构造参数:Frame对象,String的标题,模式 窗体内部的内容,Label对象,Button对象,调用Dial ...
- dialog - 从 shell 显示对话框
总览 (SYNOPSIS) dialog --clear dialog --create-rc file dialog --print-maxsize dialog common-options bo ...
- 【转载】怎样使用ZEMAX导出高质量的图像动画
Zemax 导出高质量图片与动画 (2013-08-13 11:01:51) http://blog.sina.com.cn/s/blog_628dd2bc0101dycu.html 转载▼ How ...
随机推荐
- Python3中的运算符
一.Python3中的运算符 强调这是Python3中的运算符 + 加法 - 减法 * 乘法 / 除法 // 整除,只要整数部分 ** 幂运算 % 取余数 ...
- Ubuntu16.04通过GPT挂载硬盘
一般而言,服务器上挂载的硬盘都是比较大的,传统的对硬盘进行分区需要在终端敲sudo fdisk进行操作,但是, 当挂载的硬盘的容量大于2T的时候,是无法通过sudo fdisk进行挂载的,这个时候必须 ...
- NOI-1.1-08-字符三角形
08:字符三角形 总时间限制: 1000ms 内存限制: 65536kB 描述 给定一个字符,用它构造一个底边长5个字符,高3个字符的等腰字符三角形. 输入 输入只有一行, 包含一个字符. 输出 ...
- Maxscale-在第一个节点的配置
[maxscale]threads=4 ##### Write Service, need to set address[server1]type=serveraddress=172.16.50.36 ...
- 牛客G-指纹锁【一题三解】
链接:https://www.nowcoder.com/acm/contest/136/G来源:牛客网 题目描述 HA实验有一套非常严密的安全保障体系,在HA实验基地的大门,有一个指纹锁. ...
- 【挑战赛16A】【取石子】【组合数学】
链接:https://www.nowcoder.com/acm/contest/113/A 来源:牛客网 取石子时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言5 ...
- 《DSP using MATLAB》Problem 5.31
第3小题: 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Out ...
- word怎么在方框中打对号
最快最简单的方法,是在word里输入一个大写的R,然后选中并将字体改为wingdings2,至于那个带叉号的方框图形,可以输入大写字母T并将字体设置为windings2
- Singer 学习五 docker 运行说明
介绍过一个工具knots ,方便Singer 可视化开发的工具,但是默认这个工具包含的tap 以及target 比较少(可以自己扩展) 同时这个工具就是基于docker 运行的 docker 运行的几 ...
- 修改VS2017模板文件,添加文件头部自定义注释
找到Class.cs文件 找到VS2017安装目录下面的Class.cs文件,一般在C盘或者D盘 模块文件位置: 接口模版:C:\Program Files (x86)\Microsoft Visua ...




►
►




