|
楼主 |
发表于 2009-6-15 09:45:43
|
显示全部楼层
本帖最后由 liangxm 于 2009-6-15 09:48 编辑
Opt("WinTitleMatchMode", 1)
; 处理输入命令
AdlibEnable("user")
Func user()
If WinExists("文件夹已存在","已存在") Then
ControlClick("文件夹已存在","已存在","Button1")
EndIf
EndFunc
Local $sUserName = "administrator"
Local $sPassword = "123456"
$file = "\auto_install\WoptiFree-V7.93Build9.305\WoptiFree.exe"
$dir = "D:\Program Files\Wopti\"
$title1 = "安装 - Windows优化大师"
RunAs($sUserName, @ComputerName, $sPassword, 0, $file)
WinWait($title1,"欢迎使用 Windows优化大师 安装向导")
If Not WinActivate($title1,"欢迎使用 Windows优化大师 安装向导") Then
WinActivate($title1,"欢迎使用 Windows优化大师 安装向导")
WinWaitActive($title1,"欢迎使用 Windows优化大师 安装向导")
EndIf
ControlClick($title1,"欢迎使用 Windows优化大师 安装向导","TNewButton1")
WinWait($title1,"许可协议")
If Not WinActivate($title1,"许可协议") Then
WinActivate($title1,"许可协议")
WinWaitActive($title1,"许可协议")
EndIf
Send("!a")
ControlClick($title1,"许可协议","TNewButton2")
WinWait($title1,"选择目标位置")
If Not WinActivate($title1,"选择目标位置") Then
WinActivate($title1,"选择目标位置")
WinWaitActive($title1,"选择目标位置")
EndIf
Send($dir )
Sleep(1000)
ControlClick($title1,"选择目标位置","TNewButton3")
WinWait($title1,"选择开始菜单文件夹")
If Not WinActivate($title1,"选择开始菜单文件夹") Then
WinActivate($title1,"选择开始菜单文件夹")
WinWaitActive($title1,"选择开始菜单文件夹")
EndIf
ControlClick($title1,"选择开始菜单文件夹","TNewButton4")
WinWait($title1,"要执行哪些附加任务")
If Not WinActivate($title1,"要执行哪些附加任务") Then
WinActivate($title1,"要执行哪些附加任务")
WinWaitActive($title1,"要执行哪些附加任务")
EndIf
;;;这个地方不知道怎么取消,只好用这种土办法了;;;
Send("!d")
Send("{down}")
Send("{space}")
;;;这个地方不知道怎么取消,只好用这种土办法了;;;
ControlClick($title1,"要执行哪些附加任务","TNewButton4")
AdlibDisable() |
|