pzg's blog

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

《 “AU3域环境中普通用户安装软件” 》 有 7 条评论

  1. Yin Pengjie 的头像

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

    1. countmeon 的头像

      暂不交换连接呢

    2. countmeon 的头像

      已经很久没有更新过了 暂不加连接了

  2. 6779fd1ce珂兰钻石 的头像

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

    1. countmeon 的头像

      少发外联吧 尤其你这种随机码的外联

  3. 葛小米 的头像
    葛小米

    版主,求你的setup.ini文件

    1. countmeon 的头像

      好的,不过时间太久了,我已经没有了

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注