zhoudf 发表于 2013-6-13 13:33:29

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

本帖最后由 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")

zhoudf 发表于 2013-6-13 13:35:45

就停上安装的那一步都不动了,我把最后两步换成
$hWnd = WinWaitActive("")
ControlSend($hWnd, "", "Button1", "{ENTER}")
也不行,不知道应该怎么写,请大大门帮忙看看我应该怎么写?

xjdjpbp 发表于 2013-6-13 16:11:37


ControlClick("Microsoft Security Essentials", "","")


這樣不知道行不行

zhoudf 发表于 2013-6-13 16:22:06

回复 3# xjdjpbp


    没有用,呵呵。

xms77 发表于 2013-6-14 18:27:08

本帖最后由 xms77 于 2013-6-14 18:29 编辑

回复 4# zhoudf
ControlClick("Microsoft Security Essentials", "","")

lxwlxwayy 发表于 2013-6-14 21:25:25

用send试下吧

zhoudf 发表于 2013-6-15 14:31:07

回复 5# xms77
这样不行,最我加一行向左的键,然后Send("{ENTER}")就行了
在此表示感谢回复。

smooth 发表于 2013-6-15 21:24:21

学习了,原来一直不知道软件自动安装是怎么做的。

xms77 发表于 2013-6-17 12:25:04

回复 7# zhoudf
建议用句柄代替窗体标题,使用WinGetHandle试试,稳定性高,可以后台操作。

zhoudf 发表于 2013-6-19 08:57:36

回复 9# xms77


   没有这这样写过,能不能举例说明一下,谢谢。

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")
页: [1]
查看完整版本: MSE自动安装脚本最后两步无法执行,请大帮忙看看(已解决)