自动安装出问题了。谁帮我看看代码哪里有错。
本帖最后由 chenjt819 于 2009-7-19 11:48 编辑office2003哪里出错了?
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
Run('C:\Documents and Settings\Administrator\桌面\tools\Office2003.exe')
WinWait("Microsoft Office 2003 安装","Microsoft Office Pro")
If Not WinActive("Microsoft Office 2003 安装","Microsoft Office Pro") Then WinActivate("Microsoft Office 2003 安装","Microsoft Office Pro")
WinWaitActive("Microsoft Office 2003 安装","Microsoft Office Pro")
Send("{TAB}{TAB}{TAB}{ALTDOWN}n{ALTUP}{ALTDOWN}o{ALTUP}{TAB}{TAB}{TAB}{ALTDOWN}n{ALTUP}{ALTDOWN}i{ALTUP}")
WinWait("Microsoft Office 2003 安装","Microsoft Office 200")
If Not WinActive("Microsoft Office 2003 安装","Microsoft Office 200") Then WinActivate("Microsoft Office 2003 安装","Microsoft Office 200")
WinWaitActive("Microsoft Office 2003 安装","Microsoft Office 200")
Send("{ALTDOWN}f{ALTUP}") 把代码复制出来 还有发个错误的截图最好 晕。原来下载这里的附件也要收费啊~。。。恼火。。。 Func setup_office2003()
;BlockInput(1)
Run("office11/setup.exe")
If @error Then Return
WinWaitActive("Microsoft Office 2003 安装","")
If WinExists("Microsoft Office 2003 安装","维护模式选项") Then
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","是否确认要从本机上删除")
Send("!y")
WinWaitActive("Microsoft Office 2003 安装","已从本机上删除")
Send("{ENTER}")
Run("office11/setup.exe")
EndIf
WinWaitActive("Microsoft Office 2003 安装","产品密钥")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
ControlSetText("Microsoft Office 2003 安装","","","XXXXX")
While ControlCommand("Microsoft Office 2003 安装","","","IsEnabled","")
Send("!n")
WEnd
WinWaitActive("Microsoft Office 2003 安装","用户信息")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","最终用户许可协议")
Send("!a")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","安装类型")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlSetText("Microsoft Office 2003 安装","","",@ProgramFilesDir & "\Microsoft Office\")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","请选择要安装的 Microsoft Office 2003 应用程序")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlCommand ("Microsoft Office 2003 安装","","","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
ControlCommand ("Microsoft Office 2003 安装","","","UnCheck","")
ControlCommand ("Microsoft Office 2003 安装","","","Check","")
Sleep("500")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","请选择应用程序和工具的安装选项")
Send("{SPACE}{DOWN 2}{ENTER}")
Send("{DOWN 3}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN 2}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN 2}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN}{RIGHT}")
Send("{DOWN}{RIGHT}")
Send("{DOWN}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN 2}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN 3}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN 10}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN 7}{RIGHT}")
Send("{DOWN 9}{SPACE}{DOWN 4}{ENTER}")
Send("{DOWN 3}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN}{SPACE}{DOWN 3}{ENTER}")
Send("{DOWN 4}{SPACE}{DOWN 4}{ENTER}")
Send("!n")
WinWaitActive("Microsoft Office 2003 安装","摘要")
Send("!i")
WinWaitActive("Microsoft Office 2003 安装","安装已完成")
Send("!f")
FileCopy(@ProgramsCommonDir & "\Microsoft Office\Microsoft Office Word 2003.lnk",@DesktopDir & "\",9)
FileCopy(@ProgramsCommonDir & "\Microsoft Office\Microsoft Office Excel 2003.lnk",@DesktopDir & "\",9)
FileCopy(@ProgramsCommonDir & "\Microsoft Office\Microsoft Office PowerPoint 2003.lnk",@DesktopDir & "\",9)
RunWait("Office2003SP3-KB923618-FullFile-CHS.exe /q")
BlockInput(0)
EndFunc 用的是2007,2003也是精简的,难于一起研究了。 截图截图呀,形象点 不错啊,支持下楼主吧!
页:
[1]