各位先進,
我本來想用bat去派送軟體(exe),權限已經是admin,但還是卡在UAC的提示畫面,要選擇是或否。
或是有其他方式,在不關閉UAC的條件下,也可以達到派送軟體的作業。
謝謝
;通知使用者
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("軟體自動更新", 480, 100)
$randomNumber = 1
$countdown = GUICtrlCreateLabel("系統即將更新個人電腦資料備份軟體 Synology Drive 版本 (視窗將在 " & $randomNumber & " 秒後自動關閉)", 20, 40)
GUISetState(@SW_SHOW)
While $randomNumber > 0
$nMsg = GUIGetMsg()
sleep(1000)
$randomNumber = $randomNumber -1
GUICtrlSetData(1,$countdown,$randomNumber)
$countdown = GUICtrlCreateLabel("系統即將更新個人電腦資料備份軟體 Synology Drive 版本 (視窗將在 " & $randomNumber & " 秒後自動關閉)", 20, 40)
WEnd
Local $sUserName = "Administrator"
Local $sPassword = "123456789"
;下載並自動安裝
FileCopy("\\192.168.11.150\共用資料夾\Software\SynologyDriveClient.exe","d:\")
RunAS($sUserName,".",$sPassword,"1","D:\SynologyDriveClient.exe")
ControlClick("Installer Language", "", "[CLASS:Button; INSTANCE:1]")
ControlClick("Synology Drive Client 安裝", "", "[CLASS:Button; INSTANCE:2]")
Sleep(3000)
ControlClick("Synology Drive Client 安裝", "", "[CLASS:Button; INSTANCE:2]")
Sleep(15000)
ControlClick("Synology Drive Client 安裝", "", "[CLASS:Button; INSTANCE:2]")