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 自己改~