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 ...
随机推荐
- Java中的容器 I————浅谈List
一.List接口的继承关系 List接口是Collection接口的子接口,而ArrayList和LinkedList以及Vector是其实现类. List的特点是可以将元素维护在特定的序列中,可以再 ...
- python linecache模块读取文件的方法
转自: python linecache模块读取文件 在Python中,有个好用的模块linecache,该模块允许从任何文件里得到任何的行,并且使用缓存进行优化,常见的情况是从单个文件读取多行. l ...
- aliyun服务器对象存储oss
aliyun OSS 使用简单.方便. 官方网址 aliyun.com 首先通过aliyun管理控制台申请OSS服务.通过AccessKeys分配Access Key ID和Access Key Se ...
- Android强制横屏+全屏的几种常用方法
全屏: 在Activity的onCreate方法中的setContentView(myview)调用之前添加下面代码 1 requestWindowFeature(Window.FEATURE_NO_ ...
- Unity导航系统Navigation使用教程
Unity开发VR之Vuforia 本文提供全流程,中文翻译. Chinar 坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) Chinar -- ...
- 安卓与Unity交互之-Android Studio创建Module库模块教程
安卓开发工具创建Module库 本文提供全流程,中文翻译. Chinar 坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) Chinar -- 心分 ...
- HDU - 5785:Interesting (回文树,求相邻双回文的乘积)
Alice get a string S. She thinks palindrome string is interesting. Now she wanna know how many three ...
- NYOJ 85:有趣的数(打表,规律)
85-有趣的数 内存限制:64MB 时间限制:3000ms 特判: No 通过数:8 提交数:12 难度:2 题目描述: 把分数按下面的办法排成一个数表. 1/1 1/2 1/3 1/4- 2/1 2 ...
- scrapy框架学习之路
一.基础学习 - scrapy框架 介绍:大而全的爬虫组件. 安装: - Win: 下载:http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted pip3 ...
- python编译hello
pycharm无法找到解释器,将无法编译. 所以在编译之前进行统一设置 点击File,选择settings,点击 添加解释器 最后点击Apply.等待系统配置. 如果我们需要添加新的模块,点击绿色+号 ...




►
►




