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 ...
随机推荐
- JavaBasic_10
JVM中的对一个对象的所有初始化动作,是javac在字节码文件中帮我们生成的 1.成员变量的显式初始化 2.初始化代码块(构造代码块) 3.构造方法 初始化静态的东西 在Java中,一个没有方法体的方 ...
- 使用libcurl作为Http client
产品通过HTTP协议为外部提供接口服务,常规情况是客户通过HTTP协议请求服务,服务结束后通过HTTP协议将服务记录POST到请求方. 用原生C实现了一个简单的HTTP Client,只有简单的功能: ...
- The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online -C:Halting Problem(模拟)
C Halting Problem In computability theory, the halting problem is the problem of determining, from a ...
- 更换JDK版本时的问题:Error: could not open `C:\Java\jre7\lib\amd64\jvm.cfg'
1.先把oracle自带的weblogic给卸载了,然后打开eclipse,发现报错了:Error: could not open `C:\Java\jre7\lib\amd64\jvm.cfg' J ...
- SkyWalking+SkyApm-dotnet分布式链路追踪系统
SkyWalking+SkyApm-dotnet分布式链路追踪系统 对于普通系统或者服务来说,一般通过打日志来进行埋点,然后再通过elk或splunk进行定位及分析问题,更有甚者直接远程服务器,直接操 ...
- C++ 作业(哈夫曼树)
#include<bits/stdc++.h> #define fi first #define se second #define int long long using namespa ...
- MySQL数据库-数据表、以及列的增删改查
1.创建一个表 CREATE(创建) TABLE(表) ENGINE(引擎) ENGINE=INNODB(引擎)还有很多类引擎,这里只是简单的提一下INNODB引擎,INNODB引擎支持事务(回滚), ...
- js实现一条抛物线
抛物线运动解释: 以右开口为例,根据公式 y^2 = 2px .确定p的值,已知x求y. <!DOCTYPE html> <html> <head> <me ...
- mysql配置my.cnf文件,以及参数优化提升性能
系统centos7 mariadb通过yum安装 mysql配置文件位于/etc/my.cnf 常用参数: 1)max_connections设置最大连接(用户)数,其默认值为100,设置太小会出现t ...
- 怎样解题 (G. 波利亚 著)
第一部分 (已看) 目的 1. 帮助学生 2. 问题,建议,思维活动 3. 普遍性 4. 常识 5. 教师和学生,模仿和实践 主要部分,主要问题 6. 四个阶段 7. 理解题目 8. 例子 9. 拟订 ...