假如您指的是Shell指令,那很简单Shell(pathname[,windowstyle])The Shell function syntax has these named arguments:Part Description
pathname Required; Variant (String). Name of the program to execute and any required arguments or command-line switches; may include directory or folder and drive.
windowstyle Optional. Variant (Integer) corresponding to the style of the window in which the program is to be run. If windowstyle is omitted, the program is started minimized with focus.
The windowstyle named argument has these values:Constant Value Description
vbHide 0 Window is hidden and focus is passed to the hidden window.
vbNormalFocus 1 Window has focus and is restored to its original size and position.
vbMinimizedFocus 2 Window is displayed as an icon with focus.
vbMaximizedFocus 3 Window is maximized with focus.
vbNormalNoFocus 4 Window is restored to its most recent size and position. The currently active window remains active.
vbMinimizedNoFocus 6 Window is displayed as an icon. The currently active window remains active.
From MSDN
pathname Required; Variant (String). Name of the program to execute and any required arguments or command-line switches; may include directory or folder and drive.
windowstyle Optional. Variant (Integer) corresponding to the style of the window in which the program is to be run. If windowstyle is omitted, the program is started minimized with focus.
The windowstyle named argument has these values:Constant Value Description
vbHide 0 Window is hidden and focus is passed to the hidden window.
vbNormalFocus 1 Window has focus and is restored to its original size and position.
vbMinimizedFocus 2 Window is displayed as an icon with focus.
vbMaximizedFocus 3 Window is maximized with focus.
vbNormalNoFocus 4 Window is restored to its most recent size and position. The currently active window remains active.
vbMinimizedNoFocus 6 Window is displayed as an icon. The currently active window remains active.
From MSDN
解决方案 »
- 今天看了一个印度电影《功夫小蝇/苍蝇侠》,被它小小的感动了一把,推荐下
- 关于access表中日期的判断
- 把字体的颜色改成红色怎么改?
- 水晶报表多表查询出了问题,急!!!!!!
- 谁能api使用说明手册下载
- 高手请进
- 很奇怪的问题(关于变量的作用域)
- 我怎样才能使程序一次只能运行一个(同一程序)!
- 200分急救。请各位朋友一定进来看看。先谢谢了。
- 关于Printer问题!!快!!(最好有printer用法祥细说明)
- “CDate("12:30:00")-CDate("11:20:00")=4200(秒)”最简单的算法(或函数)是什么?
- 为什么每次运行都会出现“text is read only”消息框?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/Shell/programmersguide/legacyinformation/shelllib.asp
执行一个可执行文件,返回一个 Variant (Double),如果成功的话,代表这个程序的任务 ID,若不成功,则会返回 0
Shell 函数
执行一个可执行文件,返回一个 Variant (Double),如果成功的话,代表这个程序的任务 ID,若不成功,则会返回 0。语法Shell(pathname[,windowstyle])Shell 函数的语法含有下面这些命名参数:部分 描述
pathname 必要参数。Variant (String),要执行的程序名,以及任何必需的参数或命令行变量,可能还包括目录或文件夹,以及驱动器。
Windowstyle 可选参数。Variant (Integer),表示在程序运行时窗口的样式。如果 windowstyle 省略,则程序是以具有焦点的最小化窗口来执行的。
windowstyle 命名参数有以下这些值:常量 值 描述
vbHide 0 窗口被隐藏,且焦点会移到隐式窗口。
VbNormalFocus 1 窗口具有焦点,且会还原到它原来的大小和位置。
VbMinimizedFocus 2 窗口会以一个具有焦点的图标来显示。
VbMaximizedFocus 3 窗口是一个具有焦点的最大化窗口。
VbNormalNoFocus 4 窗口会被还原到最近使用的大小和位置,而当前活动的窗口仍然保持活动。
VbMinimizedNoFocus 6 窗口会以一个图标来显示。而当前活动的的窗口仍然保持活动。
说明如果 Shell 函数成功地执行了所要执行的文件,则它会返回程序的任务 ID。任务 ID 是一个唯一的数值,用来指明正在运行的程序。如果 Shell 函数不能打开命名的程序,则会产生错误。注意 缺省情况下,Shell 函数是以异步方式来执行其它程序的。也就是说,用 Shell 启动的程序可能还没有完成执行过程,就已经执行到 Shell 函数之后的语句。
本示例使用 Shell 函数来完成一个用户指定的应用程序。' 将第二个参数值设成 1,可让该程序以正常大小的窗口完成,并且拥有焦点。
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' 完成Calculator。
本示例使用 Shell 函数来完成一个用户指定的应用程序。' 将第二个参数值设成 1,可让该程序以正常大小的窗口完成,并且拥有焦点。
Dim RetVal
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1) ' 完成Calculator。