tradertt Posted March 30, 2006 Share Posted March 30, 2006 Hi I want to create a Auto Shutdown script to close my computer and I want to be able to enter the time I want it to shut down #NoTrayIcon Sleep(60000) Shutdown(13) How do I create that? When ever I run it, it will pop up and ask me how many minutes or hours I want it to shutdown Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
ChrisL Posted March 30, 2006 Share Posted March 30, 2006 Designed to run a "task" and time/day settings from an ini file but you can modify it.. $g_szVersion = "QShed" If WinExists($g_szVersion) Then Exit; It's already running AutoItWinSetTitle($g_szVersion) Opt("TrayAutoPause",0) Opt("TrayMenuMode",1) $days = IniRead ("Qshed.ini" , "General" , "Days", "Sun") $ShedTime = Number (IniRead ("Qshed.ini" , "General" , "Time", "0300")) Local $aDayOfWeek[8] $aDayOfWeek[1] = "Sun" $aDayOfWeek[2] = "Mon" $aDayOfWeek[3] = "Tue" $aDayOfWeek[4] = "Wed" $aDayOfWeek[5] = "Thu" $aDayOfWeek[6] = "Fri" $aDayOfWeek[7] = "Sat" $aDays = Stringsplit ($Days, ",") While 1 $CurrentTime = Number (@Hour & @Min) For $i = 1 to Ubound ($aDays) -1 If $aDays[$i] = $aDayOfWeek[@WDAY] Then If Number ($CurrentTime) = Number ($ShedTime) Then MsgBox (0,"Run","Run the scheduled task here but sleep for 1 minute after run to avoid running twice") Sleep (60000) EndIf Endif Sleep (1000) Next Wend [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted March 30, 2006 Moderators Share Posted March 30, 2006 Something like this should work: $time = InputBox("Shutdown", "How many seconds do you want to wait?") Run("Shutdown -s -f -t " & $time) Link to comment Share on other sites More sharing options...
tradertt Posted March 30, 2006 Author Share Posted March 30, 2006 Should Shutdown -s - f -t be the same as Shutdown (13) ? Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted March 30, 2006 Moderators Share Posted March 30, 2006 Should Shutdown -s - f -t be the same as Shutdown (13) ?It would be the same as Shutdown(5) Link to comment Share on other sites More sharing options...
tradertt Posted March 30, 2006 Author Share Posted March 30, 2006 Would it be able to do Shutdown ( 1 + 4 + 8) ? Free Flash Games Online | Car Modifications Articles | Free Arcade Games Online Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted March 30, 2006 Moderators Share Posted March 30, 2006 Would it be able to do Shutdown ( 1 + 4 + 8) ?I'm not sure what the power down option is for, but it will turn the computer off if that is what you are asking. Link to comment Share on other sites More sharing options...
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