|
不知道有沒有那位大大有撰寫過Office2007的自動安裝腳本?
目前小弟遇到一個大問題:因安裝過程中Title都一樣,內文抓不到,造成安裝的時候程序就會自動跑到關閉的程序,
麻煩提供是否有更好的思路來完成!!謝謝
Global $office2k7user,$office2k7com,$sn
;================ 環境設定值 ================
$sn= "" ;貼序號 請連連字號(-)
$office2k7user = "USER NAME" ;設定使用者名稱
$office2k7com = "USER COMPANY" ;設定公司名稱
;================ 呼叫軟體安裝路徑 ================
MsgBox(48,"Office 2007","開始安裝 Office 2007 Project",2)
Run("C:\軟體Source\文書編輯\Office2007\setup.exe")
;================ 點到 Visio ================
If WinWait("2007 Microsoft Office system") Then
WinActivate("2007 Microsoft Office system")
EndIf
Sleep(1000)
Send("{down}") ;1
Sleep(1000)
Send("{down}") ;2
Sleep(1000)
Send("{down}") ;3
Sleep(1000)
Send("{down}") ;4
Sleep(1000)
Send("{down}") ;5
Sleep(1000)
Send("{down}") ;6
Sleep(1000)
Send("{down}") ;7
Sleep(1000)
Send("{down}") ;8
Sleep(1000)
Send("{down}") ;9
;================ 序號 ================
Sleep(1000)
Send("{enter}")
If WinWait("Microsoft Office Project Professional 2007") Then
WinActivate("Microsoft Office Project Professional 2007")
EndIf
Sleep(1000)
Send($sn) ; 開始輸入序號
sleep(1000)
Send("{enter}")
sleep(1000)
Send("!a") ;我接受
sleep(100)
Send("{enter}")
;================ 自訂軟體安裝細項 ================
If WinWait("Microsoft Office Project Professional 2007") Then
WinActivate("Microsoft Office Project Professional 2007")
EndIf
sleep(1000)
Send("{!c}") ;自訂
If WinWait("Microsoft Office Project Professional 2007","") Then
WinActivate("Microsoft Office Project Professional 2007","") ;將office 軟體完全安裝
EndIf
Sleep(700)
Send("!i") ;開始安裝
;================ 安裝軟體 END ================
If WinWait("Microsoft Office Project Professional 2007","") Then
WinActivate("Microsoft Office Project Professional 2007","")
EndIf
Sleep(1000)
WinClose("Microsoft Office Project Professional 2007") |
|