Jump to content
Sign in to follow this  
Freaky

Cool Shutdownscript

Recommended Posts

Freaky

Here is a cool shutdown script for school.

If you know the networknames on school you can enter it and shut down sombody's computer!

Realy cool! :P

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.2.0
 Author:         Freaky

 Script Function:
    Fun for school!

#ce ----------------------------------------------------------------------------
#include <GUIConstants.au3>

$options = ""
$type_input = ""
$timout_input = ""
$opmerking_input = ""



$gui=GUICreate("OnSchool proggies", 500, 50)

$type_input = GUICtrlCreateCombo ("Shutdown", 10, 20, 100, 20, $CBS_DROPDOWNLIST) ; create first item
GUICtrlSetData(-1,"Opnieuw Opstarten|Afmelden|Annuleren","Shutdown")

GUICtrlCreateLabel ("Computer", 140, 5, 100, 20)
$computer_input = GUICtrlCreateInput ("", 115, 20, 100, 20)
GUICtrlCreateLabel ("Opmerking", 240, 5, 100, 20)
$opmerking_input = GUICtrlCreateInput ("", 220, 20, 100, 20)
GUICtrlCreateLabel ("Timeout", 330, 5, 50, 20)
$timeout_input = GUICtrlCreateInput ("", 325, 20, 50, 20)

$force_input = GUICtrlCreateCheckbox ("Force", 380, 20, 50, 20)

$button = GUICtrlCreateButton("Run", 435,16)

GUISetState (@SW_SHOW)


While 1
        $msg = GUIGetMsg()
    
        If $msg = $GUI_EVENT_CLOSE Then
            ExitLoop
        EndIf
        
        If $msg = $button Then
            afsluiten()
        EndIf
        
    Wend



; Functions
Func afsluiten()
    
If GUICtrlRead($type_input) = "Shutdown" Then
    $options = " -s"
Elseif GUICtrlRead($type_input) = "Opnieuw Opstarten" Then
    $options = " -r"
Elseif GUICtrlRead($type_input) = "Afmelden" Then
    $options = " -l"
Elseif GUICtrlRead($type_input) = "Annuleren" Then
    $options = " -a"
EndIf

If GUICtrlRead($computer_input) <> "" Then
    $options = $options & " -m " & GUICtrlRead($computer_input)
EndIf

If GUICtrlRead($opmerking_input) <> "" Then
    $options = $options & " -c " & GUICtrlRead($opmerking_input)
EndIf

If BitAND(GUICtrlRead($force_input), $GUI_CHECKED) = $GUI_CHECKED Then
    $options = $options & " -f"
EndIf

If GUICtrlRead($timeout_input) <> "" Then
    $options = $options & " -t " & GUICtrlRead($timeout_input)
EndIf

Run("shutdown.exe" & $options)
MsgBox(0,"Shutdown","Done! shutdown.exe" & $options)
EndFunc

The next thing I gonna make is the NET send command without the command promt!

Very usefull for school, because on my school the run and cmd are protected!

Edited by Freaky

Share this post


Link to post
Share on other sites
Paulie

And your question is?

Share this post


Link to post
Share on other sites
Freaky

And your question is?

Nothing but I couldn't post it in the otther forum so....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.