je debute donc
merci a tous. si vous pouvez m'aider.
Code : Tout sélectionner
#include <Constants.au3>
#include <GUIConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Menu", 606, 228, 474, 355)
$OK = GUICtrlCreateButton("OK", 448, 88, 89, 65, 0)
$Input1 = GUICtrlCreateInput("TEST", 181, 72, 225, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$Input2 = GUICtrlCreateInput("TEST\", 181, 112, 225, 21)
$Input3 = GUICtrlCreateInput("", 181, 149, 225, 21)
$Domaine = GUICtrlCreateLabel("Domaine", 128, 72, 46, 17)
$User = GUICtrlCreateLabel("User", 136, 112, 26, 17)
$Password = GUICtrlCreateLabel("Password", 120, 152, 50, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$foo = Run(@ComSpec & " /c " & "netdom join %computername% /domain:"& GUICtrlRead($Input1)&" /userd:"& guictrlread($Input2)&" /passwordd:"& guictrlread($Input3))
While 1
$Msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $OK
$line = StdoutRead($foo)
MsgBox(0,"Line read",$line)
If @error Then ExitLoop
If $line = "The command completed successfully." then
MsgBox(0, "Progress", $line & " Click to Reboot")
Run(@ComSpec & " /c " & "shutdown -r -t 1")
endif
If $line <> "The command completed successfully." Then
MsgBox(0, "Progress", "Process failed Remove from domain manually")
exit
endif
Exit




