You can try this:Shell Function
Runs an executable program and returns a Variant (Double) representing the program's task ID if successful, otherwise it returns zero.SyntaxShell(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.
ResIf the Shell function successfully executes the named file, it returns the task ID of the started program. The task ID is a unique number that identifies the running program. If the Shell function can't start the named program, an error occurs.Note By default, the Shell function runs other programs asynchronously. This means that a program started with Shell might not finish executing before the statements following the Shell function are executed.
Runs an executable program and returns a Variant (Double) representing the program's task ID if successful, otherwise it returns zero.SyntaxShell(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.
ResIf the Shell function successfully executes the named file, it returns the task ID of the started program. The task ID is a unique number that identifies the running program. If the Shell function can't start the named program, an error occurs.Note By default, the Shell function runs other programs asynchronously. This means that a program started with Shell might not finish executing before the statements following the Shell function are executed.
解决方案 »
- picture1.top和picture1.left和picture1.height什么意思?
- VB 做了个小系统,总共14个窗体,想弄成系统空闲时间到10分钟后执行播放影片怎么实现
- 小妹请教一个问题:关于消息提示!望解答~
- 关于SQL语句的问题??
- 怎样去掉标题栏(在线等)
- 我用DATA REPORT做报表,用SETUP FACTORY6.0打包后,报713错误?!
- 在一个不是 Form 中怎样显示一个弹出菜单,但是不要出现 菜单Bar ?
- 请教高手:如何读取TXT文件的任意一行!
- 我是WIN2000系统 VB的SP5 为什么我不能用ADODB 我想加载控件MSADO20.TLB但。。。。
- 请教菜单和窗体的问题!
- 一个棘手的问题!~考验大家的时候到了!!!
- 白送分的问题:
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)
例如:
aaa=Shell("c:\windows\notepad.exe",vbNormalFocus)第一个参数是路径,第二个参数是窗口类型
具体参看帮助
RUN -->
start C:\Windows\notepad