gxswww 发表于 2010-4-16 22:15:37

这样写 为什么不能把安装完成后弹出的网页关闭

本帖最后由 gxswww 于 2010-4-17 23:07 编辑

Run("ppstreamsetup.exe")
WinWait("PPS影音 V2.6.86.8989 正式版","PPS影音 安装向导")
Send("!n")
WinWait("PPS影音 V2.6.86.8989 正式版","安装程序将安装")
Send("d:\pps")
Send("!n")
WinWait("PPS影音 V2.6.86.8989 正式版","要关联的媒体文件")
Send("!n")
WinWait("PPS影音 V2.6.86.8989 正式版","想要安装程序执行哪些")
ControlClick("PPS影音 V2.6.86.8989 正式版","想要安装程序执行哪些","Button5")
ControlClick("PPS影音 V2.6.86.8989 正式版","想要安装程序执行哪些","Button6")
ControlClick("PPS影音 V2.6.86.8989 正式版","想要安装程序执行哪些","Button7")
ControlClick("PPS影音 V2.6.86.8989 正式版","想要安装程序执行哪些","Button8")
Send("!n")
WinWait("安装Google工具栏","搜索覆盖过百亿中文")
ControlClick("安装Google工具栏","搜索覆盖过百亿中文","Button4")
Send("!n")
WinWait("PPS影音 V2.6.86.8989 正式版","为你推荐的软件")
ControlClick("PPS影音 V2.6.86.8989 正式版","为你推荐的软件","Button9")
Send("!i")
WinWait("PPS影音 V2.6.86.8989 正式版","已经安装在你的系统")
ControlClick("PPS影音 V2.6.86.8989 正式版","已经安装在你的系统","Button4")
Send("!f")
ProcessClose("iexplore.exe")

亮点是最后红色这句

找到办法了,把红色那段改成下面这段即可,不知道大家觉得有没有问题,

if WinWait("您已成功安装PPS影音 - Microsoft Internet Explorer") then WinClose ("您已成功安装PPS影音 - Microsoft Internet Explorer")
if WinWait("找不到服务器 - Microsoft Internet Explorer") then WinClose ("找不到服务器 - Microsoft Internet Explorer")
if WinWait("无法打开网页 - Microsoft Internet Explorer") then WinClose ("无法打开网页 - Microsoft Internet Explorer")
exit

3mile 发表于 2010-4-17 10:55:55

先得到进程PID吧

menfan 发表于 2010-4-17 11:03:29

可能开了多个IE吧,加个循环关闭iexplore.exe喽

yhxhappy 发表于 2010-4-17 15:41:40

如果用户此时还打开了别的IE窗口浏览,循环关闭IE的话会把一些正常打开的IE窗口.

可以考虑通过判断窗口标题的方法来关闭
WinWait ( "窗口标题" [, "窗口文本"] )
WinActivate ( "窗口标题" [, "窗口文本"] )
WinClose ( "窗口标题" [, "窗口文本"] )
这样做不好的就是窗口已经显示了,而且标题也未必是固定的

gxswww 发表于 2010-4-17 21:40:32

回复 4# yhxhappy


    但是如果电脑是在未联网的情况下呢。

gxswww 发表于 2010-4-17 21:41:29

回复 3# menfan


    测试的时候,。在运行脚本之前。。ie我全部关闭了。。
页: [1]
查看完整版本: 这样写 为什么不能把安装完成后弹出的网页关闭