electrico Posted August 22, 2009 Posted August 22, 2009 (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 August 23, 2009 by electrico
Yashied Posted August 22, 2009 Posted August 22, 2009 (edited) Not a bad start. Thanks for sharing.EDIT:Here is my version of the timer. Edited August 22, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now