Jump to content

Shutdown PC


 Share

Recommended Posts

Hi,

my second post :shocked: (the first post was on the rong place :( )

i want a script that shuts down the pc if you pressed any key

so, if i press the ''a'' key (and all other keys) must shutdown the pc

i hope someone can help my

greetsz UQOII

[center]uqoii.nl[/center]

Link to comment
Share on other sites

Use my :shocked:

Press CTRL+ALT+SHIFT+Q

HotKeySet("^+!q","_bye")

while 1
    Sleep(1000)
WEnd

Func _bye()
    $i=5
    $msgRet = 0
    
    for $i=5 to 0 step -1
        $msgRet = MsgBox(49,$title,"Shutdown in " & $i & " seconds",1)  
        if $msgRet = 2 then 
            $i = 0
        EndIf
        
    Next
    
    If $msgRet <> 2 Then ;spegnimento
        MsgBox(0,$title,"Ciao ciao!",1)
        Shutdown(13)
    Else
        MsgBox(0,$title,"Shutdown cancel",2)    
    EndIf
    
EndFunc
Edited by Cyber
Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Link to comment
Share on other sites

Use my :shocked:

HotKeySet("^+!q","_bye")

while 1
    Sleep(1000)
WEnd

Func _bye()
    $i=5
    $msgRet = 0
    
    for $i=5 to 0 step -1
        $msgRet = MsgBox(49,$title,"Shutdown in " & $i & " seconds",1)  
        if $msgRet = 2 then 
            $i = 0
        EndIf
        
    Next
    
    If $msgRet <> 2 Then ;spegnimento
        MsgBox(0,$title,"Ciao ciao!",1)
        Shutdown(13)
    Else
        MsgBox(0,$title,"Shutdown cancel",2)    
    EndIf
    
    

    Exit
EndFunc
i'll test it :(

[center]uqoii.nl[/center]

Link to comment
Share on other sites

Hi,

my second post :shocked: (the first post was on the rong place :( )

i want a script that shuts down the pc if you pressed any key

so, if i press the ''a'' key (and all other keys) must shutdown the pc

i hope someone can help my

greetsz UQOII

#Include <Misc.au3>
For $Chars = 32 to 127
     $HChars = Hex($Chars)
     If _IsPressed($HChars) then
          MsgBox(0,"test", "Your computer would have shut down.") ;Replace this line with: Shutdown(1)
     EndIf
Next

Thats not every button, but its most of them...

Link to comment
Share on other sites

sorry, I forget the $title variable :(

and remove exit before EndFunc :shocked:

HotKeySet("^+!c","_bye")

$title = "ShutDown"

while 1
    Sleep(1000)
WEnd

Func _bye()
    $i=5
    $msgRet = 0
    
    for $i=5 to 0 step -1
        $msgRet = MsgBox(49,$title,"Shutdown in " & $i & " seconds",1)  
        if $msgRet = 2 then 
            $i = 0
        EndIf
        
    Next
    
    If $msgRet <> 2 Then ;spegnimento
        MsgBox(0,$title,"Ciao ciao!",1)
        Shutdown(13)
    Else
        MsgBox(0,$title,"Shutdown cancel",2)    
    EndIf

EndFunc
Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...