However, I need some settings changed and I'm struggling to figure out how to make it happen.
Here's what I currently have, it's set up to make a scheduled task to run Notepad at a time you choose at the start.
I did not write this code, I barely understand it. I have modified it for my purposes and commented out anything I understand I don't need.
Code: Select all
InputBox, count, SCHEDULE TASK,Please set the time you would like SCHEDULE TASK to start.`nFormat is '12:00' in 24 hour time., ,240,160,200,200,,,22:30
;=========== THIS BLOCK WILL SET THE SCHEDULE TASK ==========
TriggerType = 2 ; specifies a time-based trigger.
ActionTypeExec = 0 ; specifies an executable action.
LogonType = 3 ; Set the logon type to interactive logon
TaskCreateOrUpdate = 6
;********************************************************
; Create the TaskService object.
service := ComObjCreate("Schedule.Service")
service.Connect()
;********************************************************
; Get a folder to create a task definition in.
rootFolder := service.GetFolder("\")
; The taskDefinition variable is the TaskDefinition object.
; The flags parameter is 0 because it is not supported.
taskDefinition := service.NewTask(0)
;********************************************************
; Define information about the task.
; Set the registration info for the task by
; creating the RegistrationInfo object.
regInfo := taskDefinition.RegistrationInfo
regInfo.Description := "Task Description"
regInfo.Author := "Author Name"
;********************************************************
; Set the principal for the task
principal := taskDefinition.Principal
principal.LogonType := LogonType ; Set the logon type to interactive logon
; Set the task setting info for the Task Scheduler by
; creating a TaskSettings object.
settings := taskDefinition.Settings
settings.Enabled := True
settings.StartWhenAvailable := True
settings.Hidden := False
;settings.DeleteExpiredTaskAfter := "P1D"
;********************************************************
; Create a time-based trigger.
triggers := taskDefinition.Triggers
trigger := triggers.Create(TriggerType)
; Trigger variables that define when the trigger is active.
;startTime += 30, Seconds ;start time = 30 seconds from now
startTime = 2017-01-01T%count%:00+10:00
;FormatTime,startTime,%startTime%,yyyy-MM-ddTHH`:mm`:ss
;endTime += 5, Minutes ;end time = 5 minutes from now
;FormatTime,endTime,%endTime%,yyyy-MM-ddTHH`:mm`:ss
trigger.StartBoundary := startTime
;trigger.EndBoundary := endTime
trigger.ExecutionTimeLimit := "PT5M" ;Five minutes
trigger.Id := "TimeTriggerId"
trigger.Enabled := True
;***********************************************************
; Create the action for the task to execute.
; Add an action to the task to run notepad.exe.
Action := taskDefinition.Actions.Create( ActionTypeExec )
Action.Path := "C:\Windows\System32\notepad.exe"
;***********************************************************
; Register (create) the task.
rootFolder.RegisterTaskDefinition("Test - Schedule", taskDefinition, TaskCreateOrUpdate ,"","", 3)
;========== END OF SCHEDULE TASK SECTION ===========
Here: https://i.imgur.com/8Gzf4EH.png
And here: https://i.imgur.com/D0Y6Pfn.png
I've been trying to make heads and tails of these posts here: https://autohotkey.com/board/topic/6104 ... ely-ahk-l/
and here: https://github.com/halpo/NppToR/blob/ma ... eduler.ahk
Which may have my answer in there, but I don't understand it enough to implement it.
If anyone here can help me that would be excellent.
Thanks.