TA的每日心情 | 开心 2015-7-19 17:54 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
问题源代码如下:
Dim aaa
aaa="C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
Set oShell = CreateObject("WSCript.Shell")
oShell.Run aaa,2,true
Set oShell = Nothing
参照QTP的HELP:Run Method的用法
解决后代码如下:
Dim oShell
Dim a
'C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe
a="cmd /K CD C:\Program Files\HP\QuickTest Professional\samples\flight\app\ & flight4a.exe"
Set oShell = CreateObject ("WSCript.shell")
oShell.run a
Set oShell = Nothing
出现新问题:CMD窗口无法自动关闭
解决办法:oShell.run a,0 (查看任务管理器,cmd.exe进程关闭) |
|