AU3域环境中普通用户安装软件

#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

0 0 投票数
文章评分
订阅评论
提醒
guest

7 评论
最旧
最新 最多投票
内联反馈
查看所有评论
Yin Pengjie
2011年8月24日 10:06

希望能与大神交换个链接呢~小弟是学网页设计的~

6779fd1ce珂兰钻石
2011年9月13日 19:58

6779fd1ce请教一下博主,我的站被K了,怎么才能恢复呢?

葛小米
葛小米
2018年6月6日 17:38

版主,求你的setup.ini文件

7
0
希望看到您的想法,请您发表评论x