u0000999 Posted April 28, 2018 Share Posted April 28, 2018 Hello. I've got my script and I need to create schedule for this script: from 0.00 to 13.00 every 30 minutes activate my script. It should be activated at the end of the 30 min period -1 second. For instance 23.59.59, 00.30.59. 00.59.59, 1.29.59 and so on.... Regards, Oleg! Link to comment Share on other sites More sharing options...
aa2zz6 Posted April 28, 2018 Share Posted April 28, 2018 You can use task scheduler to do this Link to comment Share on other sites More sharing options...
TheXman Posted April 28, 2018 Share Posted April 28, 2018 Have you thought about using a Windows Scheduled Task? If you want pointers on how to do it using AutoIt, I would suggest posting your attempt at scripting it so that someone can help you understand why it didn't work and possibly help you get it working. CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
hotkidd Posted August 7, 2018 Share Posted August 7, 2018 On 4/29/2018 at 1:48 AM, aa2zz6 said: You can use task scheduler to do this Hi @aa2zz6, do you know why Win10 task scheduler doesnt work when I scheduled an AutoIT script in it? I posted another question with more details: Link to comment Share on other sites More sharing options...
KickStarter15 Posted August 7, 2018 Share Posted August 7, 2018 @u0000999, Maybe you can get some idea with this. This auto updater of mine will have to input time and date depending on when should I wanted it to run. However, it will exit the loop when it met the desired input time and once done processing the program. Hope you can start on this. But once you completed the first task, then you can loop back to the next task if you want. Here's the hours, minutes and seconds: $time = @HOUR&":"&@MIN&":"&@SEC Here's the code: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ColorConstants.au3> $Form1 = GUICreate("Auto-Updating Tool", 369, 194, 500, 124) GUISetBkColor(0xABB1B4) $MonthCal1 = GUICtrlCreateMonthCal("", 8, 16, 229, 164) $ButtonRun = GUICtrlCreateButton("Run", 256, 104, 97, 33) $ButtonVld = GUICtrlCreateButton("Validate", 256, 35, 97, 33) $ButtonClose = GUICtrlCreateButton("Close", 256, 144, 97, 33) $InDate = GUICtrlCreateInput("",255, 15, 40, 20) GUICtrlSetState($InDate, $GUI_Disable) $timeHr = GUICtrlCreateInput("",295, 15, 30, 20) $timeMin = GUICtrlCreateInput("",325, 15, 30, 20) GUICtrlCreateLabel("Clendar", 100, 0, 38, 15) GUICtrlCreateLabel("Date", 262, 0, 35, 15) GUICtrlCreateLabel("Hr.", 305, 0, 35, 15) GUICtrlCreateLabel("Min.", 332, 0, 35, 15) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $ButtonClose Exit Case $ButtonVld $Date = @YEAR & "/" & @MON & "/" & @MDAY MsgBox(64,"Information", "Date: " & GUICtrlRead($MonthCal1) & @CRLF & "Time: " & GUICtrlRead($timeHr) & ":" & GUICtrlRead($timeMin) & @CRLF & "User: " & @UserName) $Time = @HOUR&":"&@MIN&":"&@SEC MsgBox(64,"Time", $Date & " Time is: " & $Time) GUICtrlSetData($InDate, GUICtrlRead($MonthCal1)) Call("ReturnVal") Case $ButtonRun If GUICtrlRead($timeHr) = "" Then MsgBox(64, "Warning:", "Warning: Input desired hour!") Call("ReturnVal") ElseIf GUICtrlRead($timeMin) = "" Then MsgBox(64, "Warning:", "Warning: Input desired minutes!") Call("ReturnVal") Else GUISetState(@SW_HIDE) While True Sleep(1000) $Date = @YEAR & "/" & @MON & "/" & @MDAY If $Date = GUICtrlRead($InDate) And GUICtrlRead($timeHr) = @HOUR And GUICtrlRead($timeMin) = @MIN Then RunWait("notepad.exe"); just a sample what program to run... DirCopy("D:\Programs\Autoit\", @ScriptDir & "\New Version", 1) GUIDelete($Form1) Call("Close") ExitLoop EndIf Sleep(1000) WEnd EndIf EndSwitch WEnd Func Close() Exit EndFunc Func ReturnVal() Return EndFunc Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare. 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