Sign in to follow this  
Followers 0
electrico

Small autoshutdown script.

2 posts in this topic

#1 ·  Posted (edited)

This is small autoshutdown script. Please use it if you like it >_<.

-=electrico=-

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=Clock-2.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;Auto Shutdown For Petrovich
Opt("TrayAutoPause",0)
Local $turnoff, $countdown
HotKeySet ("{F2}", "canceljob")
$turnoff = InputBox ("Auto Shutdown by electrico", "Please set the countdown time in minutes, after your PC will be automatically turned off. Please do not forget to save all data. (Note: never rename this file onto another one. File name must be 'autoshutdown.exe')") * 60000
$countdown = $turnoff
If $turnoff >0 Then 
Sleep ($countdown)
doshutdown()
EndIF
If $turnoff = 0 Then 
    otherfunc()
EndIf
If $turnoff <0 Then
    notime()
EndIf
Func doshutdown()
MsgBox (48, "Warning!", "Now PC is going to be off... 2 minutes remaining... If you did not expected it, please push F2 key now!", 120)
Shutdown (5)
EndFunc
Func canceljob()
    ProcessClose ("autoshutdown.exe")
EndFunc
Func notime()
    MsgBox (16, "Autoshutdown error", "Please set the correct time")
EndFunc
Func otherfunc()
    MsgBox (48, "Attention!", "Cancel pressed or incorrect data entered.")
EndFunc

Edited by electrico

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  
Followers 0