#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_outfile=..\桌面\安装程序.exe
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate(“安装软件列表”, 193, 151, 490, 274)
$Combo1 = GUICtrlCreateCombo(“请选择安装的文件”, 24, 40, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
$Button1 = GUICtrlCreateButton(“安装”, 56, 96, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$username=”administrator” ;定义安装程序账号
$domain=”yourdomain” ;定义账号所在域 或者计算机名
$password= “yourpassword” ;定义账号密码
$path=”D:\test\setup.ini”;定义安装软件目录文件
;———————————————————————-
Dim $str ;定义下拉列表变量
$var = IniReadSection($path, “config”) ;获取ini文件内容到数组
If @error Then
MsgBox(4096, “”, “错误, 读取INI文件失败.”)
Else
For $i = 1 To $var[0][0]
$str &= $var[$i][0]&”|”
Next
EndIf
GUICtrlSetData($Combo1 ,$str, “”) ; 赋值给下拉列表
;———————————————————————-
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
setup()
EndSwitch
WEnd
Func setup ()
$name=GUICtrlRead($Combo1)
$exe = IniRead($path, “config”, $name, “NotFound”)
Local $pid = RunAsWait( $username,$domain , $password,1, $exe , @ScriptDir )
ProcessWaitClose($pid)
EndFunc
发表回复