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 ...
随机推荐
- $interpolateProvider
angular.module('emailParser', []) .config(['$interpolateProvider', function($interpolateProvider) { ...
- a标签总结
一.<a>定义和用法 <a> 标签定义超链接,用于从一张页面链接到另一张页面. <a> 元素最重要的属性是 href 属性,它指示链接的目标. 在所有浏览器中 ...
- pc端复制方法
dom结构如下: <div id="btn">复制</div> <input id="content" type="te ...
- 20155208徐子涵 2016-2017-2 《Java程序设计》第2周学习总结
20155208徐子涵 2016-2017-2 <Java程序设计>第2周学习总结 教材学习内容总结 第三章 基础语法 3.1 类型.变量与运算符 • 关键字:在定义java文件名的时候要 ...
- ajax解决跨域
http://www.cnblogs.com/sunxucool/p/3433992.html 为什么会出现跨域跨域问题来源于JavaScript的同源策略,即只有 协议+主机名+端口号 (如存在)相 ...
- exception in thread "http-apr-80-exec-24" java.lang.OutOfMemoryError:PermGen...
今天客户说项目访问不了了,我急忙看了下告警,发现上报:“exception in thread "http-apr-80-exec-24" java.lang.OutOfMemor ...
- SimpleDateFormat未抛出ParseException
关于SimpleDateFormat的不严格性[技术探讨]今天一组员写了几段Java代码,发现如下问题: SimpleDateFormat sdf = new SimpleDateFor ...
- Singer 学习六 运行&&开发taps、targets (一 taps 运行说明)
文章内容来来自官方github 说明: singer大部分的taps && targets 是用python编写的,所以内容里面的代码也是使用python 编写 使用python运行s ...
- 漫谈 C++ 的 内存堆 实现原理
如果我来设计 C++ 的 内存堆 , 我会这样设计 : 进程 首先会跟 操作系统 要 一块大内存区域 , 我称之为 Division , 简称 div . 然后 , 将这块 div 作为 堆 , 就可 ...
- MySQL 5.7新特性之在线收缩undo表空间
1. MySQL 5.5时代的undo log 在MySQL5.5以及之前,大家会发现随着数据库上线时间越来越长,ibdata1文件(即InnoDB的共享表空间,或者系统表空间)会越来越大,这会造成2 ...




►
►




