Schulscript - endlich fertig^^

  • Hallo, endlich ist das Script für die Schule fertig. habt ihr verbesserungsvorschläge, und was haltet ihr von dem script? Angehängt sind benötigte zusatzdateien für das Lehrer prog. :rofl:
    führ lehrer:

    Spoiler anzeigen
    [autoit]

    ,
    #include <Array.au3>
    ;~ Includes
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ComboConstants.au3> ;<- Für Combolist
    #include <inet.au3> ;<- zum prüfen ob PChostname die endung le hat
    #include <Misc.au3> ;<- zum prüfen, ob Programm bereits läüft
    ;testen, ob Programm bereits läuft.Wenn ja: Hinweis darauf und beenden
    If _Singleton("Skript", 1) = 0 Then
    MsgBox(64, "MasterControl", "MasterControl läuft bereits", 5)
    Exit
    EndIf
    ; teste, ob Programm auf Lehrer PC ausgeführt wird. Wenn nicht: Meldung + Beenden
    TCPStartup()
    $hostname = _TCPIpToName(@IPAddress1)
    $hostnametest = StringSplit($hostname, "-")

    [/autoit] [autoit][/autoit] [autoit]

    If $hostnametest[0] = 3 Then ;wenn im hostname 3 - vorhanden sind dann

    [/autoit] [autoit][/autoit] [autoit]

    If $hostnametest[3] <> "le" Then
    MsgBox(64, "MasterControl", "Dieses Programm darf nur auf Lehrerrechnern ausgeführt werden")
    Exit
    EndIf
    If $hostnametest[3] <> "LE" Then
    MsgBox(64, "MasterControl", "Dieses Programm darf nur auf Lehrerrechnern ausgeführt werden")
    Exit
    EndIf
    Else ; wenn im hostname keine 2 - vorhanden sind
    MsgBox(64, "MasterControl", "Dieses Programm sollte auf einem Lehrerrechner der Schule ausgeführt werden")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    TCPShutdown()
    $pcsinraum = IniRead(@ScriptDir & "\einstellungen.ini", "infos", "pcs", "0")
    $raumnummer = IniRead(@ScriptDir & "\einstellungen.ini", "infos", "raum", "0")
    ;~ Hier startet der GUI-Code
    $Gui = GUICreate("MasterControl 1.0 BETA", 350, 320); <-- Erstelle die GUI
    GUICtrlCreateLabel("Auswahl der PCs", 10, 20)
    ; checkboxen zum PCs auswählen
    Dim $pc[$pcsinraum + 1]
    Dim $pcip[$pcsinraum + 1]
    Dim $verbindung[$pcsinraum + 1]
    Dim $datenpcfenster[$pcsinraum + 1]

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $pcsinraum
    $pc[$i] = GUICtrlCreateCheckbox($i, 10 + ((($i > 10) + ($i > 20)) * 40), 30 + ($i - (($i > (($i > 20) + 1) * 10) * (($i > 20) + 1) * 10)) * 20)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $prozentproschritt = 100 / $pcsinraum

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    ;copyright
    GUICtrlCreateLabel("© Copyright Alexander Imka", 120, 295)

    [/autoit] [autoit][/autoit] [autoit]

    ;Icon setzten
    If FileExists(@ScriptDir & "\icon.ico") Then
    GUISetIcon(@ScriptDir & "\icon.ico")
    Else
    MsgBox(48, "Icon fehlt", "Das Icon wurde nicht gefunden. Das Programm wird ohne das Icon weiter ausgeführt!")
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ;trennlinie
    If $pcsinraum < 21 Then GUICtrlCreatePic("linie.jpg", 100, 5, 2, 310)
    $Buttonuebernehmen = GUICtrlCreateButton("Übernehmen", 5, 295, 90, 25, $WS_GROUP)
    $Buttonalle = GUICtrlCreateButton("alle", 55, 265, 40, 25, $WS_GROUP)
    $buttonkeinen = GUICtrlCreateButton("keinen", 5, 265, 40, 25, $WS_GROUP)

    [/autoit] [autoit][/autoit] [autoit]

    ;Combolist
    $combo = GUICtrlCreateCombo("", 120, 10, 145, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
    GUICtrlSetData(-1, "Reboot|Sperren|Fenster|MsgBox")
    $combobutton = GUICtrlCreateButton("wechseln", 270, 10, 65, 20, $WS_GROUP)
    ; --- --- --- --- Funktionenen --- --- --- ---
    ;Reboot
    $neustart = GUICtrlCreateButton("Neustarten", 120, 100, 100, 50, $WS_GROUP)
    $herunterfahren = GUICtrlCreateButton("Herunterfahren", 120, 150, 100, 50, $WS_GROUP)
    $abmelden = GUICtrlCreateButton("Abmelden", 230, 100, 100, 50, $WS_GROUP)
    $standby = GUICtrlCreateButton("Standby", 230, 150, 100, 50, $WS_GROUP)
    GUICtrlSetState($neustart, $GUI_HIDE)
    GUICtrlSetState($herunterfahren, $GUI_HIDE)
    GUICtrlSetState($abmelden, $GUI_HIDE)
    GUICtrlSetState($standby, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    ;MsgBox
    $msgboxicon1 = GUICtrlCreateIcon("shell32.dll", 263, 120, 70)
    $msgboxicon2 = GUICtrlCreateIcon("shell32.dll", 240, 170, 70)
    GUICtrlSetState($msgboxicon1, $GUI_HIDE)
    GUICtrlSetState($msgboxicon2, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    $msgboxlabel1 = GUICtrlCreateLabel("1", 151, 72)
    $msgboxlabel2 = GUICtrlCreateLabel("2", 210, 72)
    $msgboxlabel3 = GUICtrlCreateLabel("Icon wählen:", 120, 40)
    $msgboxlabel4 = GUICtrlCreateLabel("Text eingeben:", 120, 120)
    GUICtrlSetState($msgboxlabel1, $GUI_HIDE)
    GUICtrlSetState($msgboxlabel2, $GUI_HIDE)
    GUICtrlSetState($msgboxlabel3, $GUI_HIDE)
    GUICtrlSetState($msgboxlabel4, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    $msgboxinhalt = GUICtrlCreateInput("", 112, 150, 228)
    GUICtrlSetState($msgboxinhalt, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    $iconwahl1 = GUICtrlCreateRadio("Icon1", 230, 70)
    $iconwahl2 = GUICtrlCreateRadio("Icon2", 230, 90)
    GUICtrlSetState($iconwahl1, $GUI_HIDE)
    GUICtrlSetState($iconwahl2, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    $msgboxsenden = GUICtrlCreateButton("Senden", 174, 200, 100, 50)
    GUICtrlSetState($msgboxsenden, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $pcsinraum
    $pcip[$i] = "10.20.0.254"
    Next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;hostnames zu ips
    If $hostnametest[0] = 3 Then
    ProgressOn("IP ermitteln", "Die IP's werden ermittelt")
    TCPStartup()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $pcsinraum
    $r = StringFormat("_%02u%", $i)
    ProgressSet($prozentproschritt * $i, "Rechner " & $i & " / " & $pcsinraum, "Die IP's werden ermittelt")
    If Ping("wks-" & $raumnummer & "-" & $r, 50) Then $pcip[$i] = TCPNameToIP("wks-" & $raumnummer & "-" & $r)

    [/autoit] [autoit][/autoit] [autoit]

    Next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    TCPShutdown()
    ProgressOff()
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ;sperren
    $sperreneingabe = GUICtrlCreateButton("Eingabe sperren", 120, 100, 100, 50, $WS_GROUP)
    $sperrenbildschirm = GUICtrlCreateButton("Bildschirm sperren", 120, 150, 100, 50, $WS_GROUP)
    $entsperreneingabe = GUICtrlCreateButton("Eingabe freigeben", 230, 100, 100, 50, $WS_GROUP)
    $entsperrenbildschirm = GUICtrlCreateButton("Bildschirm freigeben", 230, 150, 100, 50, $WS_GROUP)
    GUICtrlSetState($sperreneingabe, $GUI_HIDE)
    GUICtrlSetState($sperrenbildschirm, $GUI_HIDE)
    GUICtrlSetState($entsperreneingabe, $GUI_HIDE)
    GUICtrlSetState($entsperrenbildschirm, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    ; Fenster

    [/autoit] [autoit][/autoit] [autoit]

    $aktualisieren = GUICtrlCreateButton("Aktualisieren", 120, 35, 230, 20, $WS_GROUP)
    GUICtrlSetState($aktualisieren, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ; --- --- --- ---Ende Funktionen --- --- --- ---

    [/autoit] [autoit][/autoit] [autoit]

    ;starticon
    $starticon = GUICtrlCreateIcon("shell32.dll", 19, 200, 150);starticon
    GUISetState($starticon, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    UDPStartup()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1 ; <-- Endlosschleife anfangen

    [/autoit] [autoit][/autoit] [autoit]

    $nMsg = GUIGetMsg(); <-- Fange die Button-Events ab
    Switch $nMsg ;<-- Unterscheide die Events
    Case $GUI_EVENT_CLOSE ; <-- Wenn GUI geschlossen wird dann
    UDPShutdown()
    Exit ; <-- Skript beenden

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Case $Buttonuebernehmen
    ProgressOn("Bitte warten...", "Verbindungen werden hergestellt")

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 1 To $pcsinraum

    [/autoit] [autoit][/autoit] [autoit]

    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    $verbindung[$i] = UDPBind($pcip[$i], 2000)
    Else
    ToolTip("PC " & $i & " ist nicht erreichbar")
    Sleep(1000)
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    ProgressSet($prozentproschritt * $i, $i & "/" & $pcsinraum)

    [/autoit] [autoit][/autoit] [autoit]

    Sleep(200)
    Next

    [/autoit] [autoit][/autoit] [autoit]

    ToolTip("")
    ProgressOff()

    [/autoit] [autoit][/autoit] [autoit]

    Case $Buttonalle
    For $i = 1 To $pcsinraum
    GUICtrlSetState($pc[$i], $GUI_CHECKED)
    Next
    Case $buttonkeinen
    For $i = 1 To $pcsinraum
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    Next
    Case $combobutton

    [/autoit] [autoit][/autoit] [autoit]

    If GUICtrlRead($combo) = "Reboot" Then
    GUICtrlSetState($neustart, $GUI_SHOW)
    GUICtrlSetState($herunterfahren, $GUI_SHOW)
    GUICtrlSetState($abmelden, $GUI_SHOW)
    GUICtrlSetState($standby, $GUI_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Else
    GUICtrlSetState($neustart, $GUI_HIDE)
    GUICtrlSetState($herunterfahren, $GUI_HIDE)
    GUICtrlSetState($abmelden, $GUI_HIDE)
    GUICtrlSetState($standby, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    If GUICtrlRead($combo) = "" Then
    GUICtrlSetState($starticon, $GUI_SHOW)
    Else
    GUICtrlSetState($starticon, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If GUICtrlRead($combo) = "MsgBox" Then
    GUICtrlSetState($msgboxicon1, $GUI_SHOW)
    GUICtrlSetState($msgboxicon2, $GUI_SHOW)
    GUICtrlSetState($msgboxlabel1, $GUI_SHOW)
    GUICtrlSetState($msgboxlabel2, $GUI_SHOW)
    GUICtrlSetState($iconwahl1, $GUI_SHOW)
    GUICtrlSetState($iconwahl2, $GUI_SHOW)
    GUICtrlSetState($msgboxlabel3, $GUI_SHOW)
    GUICtrlSetState($msgboxlabel4, $GUI_SHOW)
    GUICtrlSetState($msgboxinhalt, $GUI_SHOW)
    GUICtrlSetState($msgboxsenden, $GUI_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Else
    GUICtrlSetState($msgboxicon1, $GUI_HIDE)
    GUICtrlSetState($msgboxicon2, $GUI_HIDE)
    GUICtrlSetState($msgboxlabel1, $GUI_HIDE)
    GUICtrlSetState($msgboxlabel2, $GUI_HIDE)
    GUICtrlSetState($iconwahl1, $GUI_HIDE)
    GUICtrlSetState($iconwahl2, $GUI_HIDE)
    GUICtrlSetState($msgboxlabel3, $GUI_HIDE)
    GUICtrlSetState($msgboxlabel4, $GUI_HIDE)
    GUICtrlSetState($msgboxinhalt, $GUI_HIDE)
    GUICtrlSetState($msgboxsenden, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If GUICtrlRead($combo) = "Sperren" Then
    GUICtrlSetState($sperreneingabe, $GUI_SHOW)
    GUICtrlSetState($sperrenbildschirm, $GUI_SHOW)
    GUICtrlSetState($entsperreneingabe, $GUI_SHOW)
    GUICtrlSetState($entsperrenbildschirm, $GUI_SHOW)
    Else
    GUICtrlSetState($sperreneingabe, $GUI_HIDE)
    GUICtrlSetState($sperrenbildschirm, $GUI_HIDE)
    GUICtrlSetState($entsperreneingabe, $GUI_HIDE)
    GUICtrlSetState($entsperrenbildschirm, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If GUICtrlRead($combo) = "Fenster" Then
    GUICtrlSetState($aktualisieren, $GUI_SHOW)
    Else
    GUICtrlSetState($aktualisieren, $GUI_HIDE)

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    ;;; Winlist ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    Case $aktualisieren
    $standartheight = 50
    ProgressOn("Bitte warten...", "Infos werden abgerufen")
    For $i = 1 To $pcsinraum
    If Ping($pcip[$i]) Then
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    UDPSend($verbindung[$i], "ip#" & @IPAddress1)
    Sleep(50)
    UDPSend($verbindung[$i], "fensteranfrage")
    While 1
    $datenpcfenster[$i] = UDPRecv($verbindung[$i], 50000)
    If $datenpcfenster[$i] <> "" Then ExitLoop
    ToolTip("warte auf PC " & $i)
    WEnd
    ToolTip("")
    $pcfenster1 = StringSplit($datenpcfenster[$i], "#")
    For $x = 2 To $pcfenster1[0]
    GUICtrlCreateLabel($pcfenster1, 120, $standartheight)
    $standartheight += 10
    Next
    EndIf
    EndIf
    ProgressSet($prozentproschritt * $i, "")
    Next

    [/autoit] [autoit][/autoit] [autoit]

    ProgressOff()
    ;;; Reboot ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    Case $neustart
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    UDPSend($verbindung[$i], "neustart")
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()
    Case $abmelden
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    UDPSend($verbindung[$i], "abmelden")
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()
    Case $herunterfahren
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    UDPSend($verbindung[$i], "herunterfahren")
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()
    Case $standby
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    UDPSend($verbindung[$i], "standby")
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()

    [/autoit] [autoit][/autoit] [autoit]

    ;;;sperren;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    [/autoit] [autoit][/autoit] [autoit]

    Case $sperreneingabe
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    UDPSend($verbindung[$i], "sperreneingabe")
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()

    [/autoit] [autoit][/autoit] [autoit]

    Case $sperrenbildschirm
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    UDPSend($verbindung[$i], "sperrenbildschirm")
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()

    [/autoit] [autoit][/autoit] [autoit]

    Case $entsperreneingabe
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    UDPSend($verbindung[$i], "entsperreneingabe")
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()

    [/autoit] [autoit][/autoit] [autoit]

    Case $entsperrenbildschirm
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    UDPSend($verbindung[$i], "entsperrenbildschirm")
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()

    [/autoit] [autoit][/autoit] [autoit]

    ;;;MsgBox;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    [/autoit] [autoit][/autoit] [autoit]

    Case $msgboxsenden
    If $msgboxinhalt <> "" Then
    ProgressOn("bitte warten...", "Aktion wird ausgeführt")
    For $i = 1 To $pcsinraum
    If GUICtrlRead($pc[$i]) = $GUI_CHECKED Then
    If Ping($pcip[$i]) Then
    If $iconwahl1 = $GUI_CHECKED Then
    $icon = 64
    Else
    If $iconwahl2 = $GUI_CHECKED Then
    $icon = 16
    Else
    $icon = 0
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    UDPSend($verbindung[$i], "msgbox#" & $icon & "#" & $msgboxinhalt)
    ProgressSet($prozentproschritt * $i, "")
    Else
    GUICtrlSetState($pc[$i], $GUI_UNCHECKED)
    EndIf
    EndIf
    Next
    ProgressOff()
    Else
    MsgBox(48, "", "Bitte Text eingeben")
    EndIf
    EndSwitch

    [/autoit] [autoit][/autoit] [autoit]

    WEnd ; <-- Beginne Schleife von Vorne;### Tidy Error -> while is never closed in your script.

    [/autoit]


    für Clients:

    Spoiler anzeigen
    [autoit]


    ;feststellen des Scriptpfadt
    $scriptpfad = @ScriptDir & "\" & @ScriptName

    [/autoit] [autoit][/autoit] [autoit]

    ;setzen der Testvariable
    $regtest = 0

    [/autoit] [autoit][/autoit] [autoit]

    ; überprüfen ob Schlüssel besteht und gegebenenfalls schreiben
    RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","MasterControl")
    if not @error then $regtest = 1

    [/autoit] [autoit][/autoit] [autoit]

    if $regtest = 0 Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","MasterControl","REG_SZ",$scriptpfad)
    if @error Then MsgBox(48,"Fehler","Felher beim Schreiben in die Regitery")

    [/autoit] [autoit][/autoit] [autoit]

    ;TCP und UDP Starten
    UDPStartup

    [/autoit] [autoit][/autoit] [autoit]

    ;verbindungen zulassen
    $lehrer = UDPBind(@IPAddress1,2000)

    [/autoit] [autoit][/autoit] [autoit]

    ;infos über pc standort abfragen, um winlist an lehrer zu schiken
    $lehrerip = "10.20.0.254"
    ;Schleife um auf befehle zu warten
    while 1
    Sleep(10)
    $ankommenderbefehl = UDPRecv($lehrer,1000)
    $befehl = StringSplit($ankommenderbefehl,"#")
    if $befehl[0] = 3 Then MsgBox($befehl[2],"Merke auf:",$befehl[3])
    if $befehl[0] = 2 Then $lehrerip = $befehl[2]
    if $befehl[1] = "herunterfahren" Then Shutdown (17)
    if $befehl[1] = "neustart" Then Shutdown(6)
    if $befehl[1] = "abmelden" Then Shutdown(16)
    if $befehl[1] = "standby" Then Shutdown(48)
    if $befehl[1] = "sperreneingabe" Then $eingabesperren = 1
    if $befehl[1] = "sperrenbildschirm" Then $bildschirmsperren = 1
    if $befehl[1] = "entsperreneingabe" Then $eingabesperren = 0
    if $befehl[1] = "entsperrenbildschirm" Then $bildschirmsperren = 0
    if $befehl[1] = "fensteranfrage" Then

    [/autoit] [autoit][/autoit] [autoit]

    EndIf
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]
  • Also wenn ich das Lehrer und das Client script starte, ist alles eig. normal.
    Client auch schön in der Firewall zugelassen, und den Lehrer gestartet, alle 20 PC's überprüft um zu sehen welcher meiner ist :D und alle 20 PC's waren unerreichbar.

    Meine Projekte:
    ClipBoard Manager (beendet)
    Gutes ClipBoard Verwaltungs Programm mit nützlichen Funktionen.

    HTML Creator (beendet)
    Nützliches Tool um schnell ein eigenes HTML Dokument zu erstellen.

  • das wird an den pc namen liegen da er über wks... pingt
    nicht jede schule hat ihre pc'S so benannt
    das habe ich jonathan auch schon gesagt , dass er eine eingabe oder datei macht wo alle pc namen sind damit es jeder nutzen kann