#include <Array.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
;Local $UserPass[2][2]=[['123','avc'],['321','sda']]
;_ArrayDisplay($UserPass)
Local $USERNAME[2]=['amine','XXX']
Local $PASSWORD[2]=['123','YYY']
Local $Errorid
If IsAdmin() Then
Run('Domain.exe',@ScriptDir)
Else
For $i=0 To UBound($Username)-1
;MsgBox('','','User:'&$USERNAME[$i]& @CRLF &'Pssword:'&$PASSWORD[$i])
$Errorid[$i]=RunAs($USERNAME[$i],@ComputerName,$PASSWORD[$i],0,'Domain.exe',@ScriptDir)
If @error Then ContinueLoop
If $Errorid[$i] <> 0 Then Exit
Next
$Login = GUICreate("输入管理员用户名和密码", 237, 112, 457, 270)
$Username = GUICtrlCreateInput("", 88, 8, 121, 21)
GUICtrlSetLimit(-1, 12)
$Button1 = GUICtrlCreateButton("登录", 56, 80, 115, 25)
$Password = GUICtrlCreateInput("", 88, 40, 121, 21)
$Label1 = GUICtrlCreateLabel("Username:", 8, 8, 68, 17, BitOR($SS_CENTER,$SS_CENTERIMAGE))
$Label2 = GUICtrlCreateLabel("Password:", 8, 40, 68, 17, BitOR($SS_CENTER,$SS_CENTERIMAGE))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox('','','123')
EndSwitch
WEnd
EndIf