找回密码
 加入
搜索
查看: 3193|回复: 1

[AU3基础] 单独运行正常但是加上select case后就无法按顺序执行

[复制链接]
发表于 2010-3-8 14:02:02 | 显示全部楼层 |阅读模式
本帖最后由 zking2000 于 2010-3-8 15:08 编辑

所要达到的目的是金山词霸的自动安装,分为英文版和中文版部分。单独执行都没有问题。只是加上select case后就不执行了。大家帮我看看是个啥子问题么!谢谢拉!
RunAs("a1500000437","Domchn","Computer11",2,"\\chn1414srv01\IT\Utility\Powerword2007\Client\powerword2007PE.exe")
Select
Case WinWaitActive("安装程序 - 金山词霸2007 企业版")
ControlClick("安装程序 - 金山词霸2007 企业版","","TButton1") ;Click Next
Sleep(2000) ;Script Sleep For 2 seconds
ControlClick("安装程序 - 金山词霸2007 企业版","","TRadioButton1")
ControlClick("安装程序 - 金山词霸2007 企业版","","TButton2") ;Clidck Next
Sleep(2000) ; Script sleep For 2 second
ControlClick("安装程序 - 金山词霸2007 企业版","","TEdit1") ; Focu on the first blank
Send("{BS}")
Send("owner",1) ;Input owner
ControlClick("安装程序 - 金山词霸2007 企业版","","TEdit2") ;Focu on the second blank
Send("^a") ;Select all contents
Send("{BS}")
Send("Italcementi S.P.A",1) ;Input Italcementi S.P.A
ControlClick("安装程序 - 金山词霸2007 企业版","","TButton2") ;Click Next
Sleep(2000) ;Script Sleep For 2 seconds
ControlClick("安装程序 - 金山词霸2007 企业版","","TButton3") ;Click Next
Sleep(2000)
Select
        Case WinActivate("文件夹不存在") ;popup windows
                 ControlClick("文件夹不存在","","Button1")        ;Click Yes
                 Sleep(1000) ;Script sleep for 1 second
                 ControlClick("安装程序 - 金山词霸2007 企业版","","TButton3") ;Click Next
        Case  ControlClick("安装程序 - 金山词霸2007 企业版","","TButton3") ;Click Next
        EndSelect
Sleep(2000)
ControlClick("安装程序 - 金山词霸2007 企业版","","TButton3") ;Click Next
Sleep(2000)
ControlClick("安装程序 - 金山词霸2007 企业版","","TButton3") ;Click Install
Sleep(300000)
ControlClick("安装程序 - 金山词霸2007 企业版","","TNewCheckListBox1") ;Select Run
ControlClick("安装程序 - 金山词霸2007 企业版","","TButton3") ;Click Finish
FileCopy("\\chn1414srv01\Drivers\ppconfigure.ini","C:\Program Files\Kingsoft\Powerword_2007EP\ppconfigure.ini",1)
Send("#r")
WinWaitActive("运行")
Send("shutdown -r -f",1)
Send("{ENTER}")
Case WinWaitActive("Setup - Powerword 2007 Enterprise")
ControlClick("Setup - Powerword 2007 Enterprise","","TButton1") ;Click Next
Sleep(2000) ;Script Sleep For 2 seconds
ControlClick("Setup - Powerword 2007 Enterprise","","TRadioButton1")
ControlClick("Setup - Powerword 2007 Enterprise","","TButton2") ;Clidck Next
Sleep(2000) ; Script sleep For 2 second
ControlClick("Setup - Powerword 2007 Enterprise","","TEdit1") ; Focu on the first blank
Send("{BS}")
Send("owner",1) ;Input owner
ControlClick("Setup - Powerword 2007 Enterprise","","TEdit2") ;Focu on the second blank
Send("^a") ;Select all contents
Send("{BS}")
Send("Italcementi S.P.A",1) ;Input Italcementi S.P.A
ControlClick("Setup - Powerword 2007 Enterprise","","TButton2") ;Click Next
Sleep(2000) ;Script Sleep For 2 seconds
ControlClick("Setup - Powerword 2007 Enterprise","","TButton3") ;Click Next
Sleep(2000)
Select
        Case WinActivate("Folder Does Not Exist") ;popup windows
                 ControlClick("Folder Does Not Exist","","Button1")        ;Click Yes
                 Sleep(1000) ;Script sleep for 1 second
                 ControlClick("Setup - Powerword 2007 Enterprise","","TButton3") ;Click Next
        Case  ControlClick("Setup - Powerword 2007 Enterprise","","TButton3") ;Click Next
        EndSelect
Sleep(2000)
ControlClick("Setup - Powerword 2007 Enterprise","","TButton3") ;Click Next
Sleep(2000)
ControlClick("Setup - Powerword 2007 Enterprise","","TButton3") ;Click Install
Sleep(300000)
ControlClick("Setup - Powerword 2007 Enterprise","","TNewCheckListBox1") ;Select Run
ControlClick("Setup - Powerword 2007 Enterprise","","TButton3") ;Click Finish
FileCopy("\\chn1414srv01\Drivers\ppconfigure.ini","C:\Program Files\Kingsoft\Powerword_2007EP\ppconfigure.ini",1)
Send("#r")
WinWaitActive("Run")
Send("shutdown -r -f",1)
Send("{ENTER}")
EndSelect
发表于 2010-3-8 15:51:31 | 显示全部楼层
RunAs("a1500000437", "Domchn", "Computer11", 2, "\\chn1414srv01\IT\Utility\Powerword2007\Client\powerword2007PE.exe")
$h = WinWaitActive("[REGEXPTITLE:(安装程序 - 金山词霸2007 企业版)|(Setup - Powerword 2007 Enterprise)]")
$title = WinGetTitle($h)
Select
        Case $title = "安装程序 - 金山词霸2007 企业版"
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton1") ;Click Next
                Sleep(2000) ;Script Sleep For 2 seconds
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TRadioButton1")
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton2") ;Clidck Next
                Sleep(2000) ; Script sleep For 2 second
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TEdit1") ; Focu on the first blank
                Send("{BS}")
                Send("owner", 1) ;Input owner
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TEdit2") ;Focu on the second blank
                Send("^a") ;Select all contents
                Send("{BS}")
                Send("Italcementi S.P.A", 1) ;Input Italcementi S.P.A
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton2") ;Click Next
                Sleep(2000) ;Script Sleep For 2 seconds
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton3") ;Click Next
                Sleep(2000)
                Select
                        Case WinActivate("文件夹不存在") ;popup windows
                                ControlClick("文件夹不存在", "", "Button1") ;Click Yes
                                Sleep(1000) ;Script sleep for 1 second
                                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton3") ;Click Next
                        Case ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton3") ;Click Next
                EndSelect
                Sleep(2000)
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton3") ;Click Next
                Sleep(2000)
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton3") ;Click Install
                Sleep(300000)
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TNewCheckListBox1") ;Select Run
                ControlClick("安装程序 - 金山词霸2007 企业版", "", "TButton3") ;Click Finish
                FileCopy("\\chn1414srv01\Drivers\ppconfigure.ini", "C:\Program Files\Kingsoft\Powerword_2007EP\ppconfigure.ini", 1)
                Send("#r")
                WinWaitActive("运行")
                Send("shutdown -r -f", 1)
                Send("{ENTER}")

        Case $title = "Setup - Powerword 2007 Enterprise"
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton1") ;Click Next
                Sleep(2000) ;Script Sleep For 2 seconds
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TRadioButton1")
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton2") ;Clidck Next
                Sleep(2000) ; Script sleep For 2 second
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TEdit1") ; Focu on the first blank
                Send("{BS}")
                Send("owner", 1) ;Input owner
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TEdit2") ;Focu on the second blank
                Send("^a") ;Select all contents
                Send("{BS}")
                Send("Italcementi S.P.A", 1) ;Input Italcementi S.P.A
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton2") ;Click Next
                Sleep(2000) ;Script Sleep For 2 seconds
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton3") ;Click Next
                Sleep(2000)
                Select
                        Case WinActivate("Folder Does Not Exist") ;popup windows
                                ControlClick("Folder Does Not Exist", "", "Button1") ;Click Yes
                                Sleep(1000) ;Script sleep for 1 second
                                ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton3") ;Click Next
                        Case ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton3") ;Click Next
                EndSelect
                Sleep(2000)
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton3") ;Click Next
                Sleep(2000)
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton3") ;Click Install
                Sleep(300000)
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TNewCheckListBox1") ;Select Run
                ControlClick("Setup - Powerword 2007 Enterprise", "", "TButton3") ;Click Finish
                FileCopy("\\chn1414srv01\Drivers\ppconfigure.ini", "C:\Program Files\Kingsoft\Powerword_2007EP\ppconfigure.ini", 1)
                Send("#r")
                WinWaitActive("Run")
                Send("shutdown -r -f", 1)
                Send("{ENTER}")
EndSelect
Case 内部的 Select 自己改~
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-1 07:12 , Processed in 0.079225 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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