找回密码
 加入
搜索
查看: 5206|回复: 10

[系统综合] MSE自动安装脚本最后两步无法执行,请大帮忙看看(已解决)

  [复制链接]
发表于 2013-6-13 13:33:29 | 显示全部楼层 |阅读模式
本帖最后由 zhoudf 于 2013-6-15 14:31 编辑

我的脚本是:
Run(@ScriptDir &  "\MSEInstall.exe")
WinWaitActive("Microsoft Security Essentials","欢迎使用 Microsoft Security Essentials 安装向导")
ControlClick("Microsoft Security Essentials", "","Button1")
WinWaitActive("Microsoft Security Essentials","Microsoft Security Essentials 软件许可条款")
ControlClick("Microsoft Security Essentials", "","Button1")
WinWaitActive("Microsoft Security Essentials","加入客户体验改善计划")
Send("!j")
ControlClick("Microsoft Security Essentials", "","Button4")
WinWaitActive("Microsoft Security Essentials","优化安全性")
ControlClick("Microsoft Security Essentials", "","Button2")
WinWaitActive("Microsoft Security Essentials","准备安装 Microsoft Security Essentials")
ControlClick("Microsoft Security Essentials", "","Button1")
WinWaitActive("Microsoft Security Essentials","正在完成 Microsoft Security Essentials 安装向导")
ControlClick("Microsoft Security Essentials", "","Button1")

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2013-6-13 13:35:45 | 显示全部楼层
就停上安装的那一步都不动了,我把最后两步换成
$hWnd = WinWaitActive("[CLASS:Button]")
ControlSend($hWnd, "", "Button1", "{ENTER}")
也不行,不知道应该怎么写,请大大门帮忙看看我应该怎么写?
发表于 2013-6-13 16:11:37 | 显示全部楼层

ControlClick("Microsoft Security Essentials", "","[CLASS:Button ; INSTANCE:1]")


這樣不知道行不行
 楼主| 发表于 2013-6-13 16:22:06 | 显示全部楼层
回复 3# xjdjpbp


    没有用,呵呵。
发表于 2013-6-14 18:27:08 | 显示全部楼层
本帖最后由 xms77 于 2013-6-14 18:29 编辑

回复 4# zhoudf
ControlClick("Microsoft Security Essentials", "","[CLASS:Button;INSTANCE:1]")
发表于 2013-6-14 21:25:25 | 显示全部楼层
用send试下吧
 楼主| 发表于 2013-6-15 14:31:07 | 显示全部楼层
回复 5# xms77
这样不行,最我加一行向左的键,然后Send("{ENTER}")就行了
在此表示感谢回复。
发表于 2013-6-15 21:24:21 | 显示全部楼层
学习了,原来一直不知道软件自动安装是怎么做的。
发表于 2013-6-17 12:25:04 | 显示全部楼层
回复 7# zhoudf
建议用句柄代替窗体标题,使用WinGetHandle试试,稳定性高,可以后台操作。
 楼主| 发表于 2013-6-19 08:57:36 | 显示全部楼层
回复 9# xms77


   没有这这样写过,能不能举例说明一下,谢谢。
发表于 2013-6-19 21:32:02 | 显示全部楼层
回复 10# zhoudf
大概就是这样,没有试过。
Run(@ScriptDir &  "\MSEInstall.exe")
Do
        Sleep(500)
Until WinExists("Microsoft Security Essentials","欢迎使用 Microsoft Security Essentials 安装向导")
$WinHandle = WinGetHandle("Microsoft Security Essentials","欢迎使用 Microsoft Security Essentials 安装向导")
ControlClick($WinHandle, "","Button1")
Sleep(1000)
ControlClick($WinHandle, "Microsoft Security Essentials 软件许可条款","Button1")
Sleep(1000)
WinWaitActive($WinHandle,"加入客户体验改善计划")
Send("!j")
ControlClick($WinHandle, "","Button4")
Sleep(1000)
ControlClick($WinHandle, "优化安全性","Button2")
Sleep(1000)
ControlClick($WinHandle, "准备安装 Microsoft Security Essentials","Button1")
Sleep(1000)
ControlClick($WinHandle, "正在完成 Microsoft Security Essentials 安装向导","Button1")
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-17 17:55 , Processed in 0.121001 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表