I haven’t seen a response for this yet, but… I have done work with the TaskScheduler in powershell, and in powershell you can do something like this:
PS C:\Users\Administrator.DOMAIN> (Get-ScheduledTask -TaskName mytask).Settings AllowDemandStart : True AllowHardTerminate : True Compatibility : Win8 DeleteExpiredTaskAfter : DisallowStartIfOnBatteries : True Enabled : True ExecutionTimeLimit : PT72H Hidden : False IdleSettings : MSFT_TaskIdleSettings MultipleInstances : IgnoreNew NetworkSettings : MSFT_TaskNetworkSettings Priority : 7 RestartCount : 0 RestartInterval : RunOnlyIfIdle : False RunOnlyIfNetworkAvailable : False StartWhenAvailable : False StopIfGoingOnBatteries : True WakeToRun : False DisallowStartOnRemoteAppSession : False UseUnifiedSchedulingEngine : True MaintenanceSettings : volatile : False PSComputerName : “StartWhenAvailable” is what you are looking for. You would set it to True I don’t know how to get at the TaskScheduler from python without directing you to importing C DLLs and using the ctypes module, but I hope this helps. As well, here is some documentation on TaskScheduler for Powershell https://learn.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtasksettingsset?view=windowsserver2022-ps Sorry, it’s not docs for python but I hope it helps you get closer to what you are looking for. HTH Steven From: python-win32 <[email protected]> On Behalf Of Joel Moberg Sent: Thursday, January 5, 2023 6:18 AM To: [email protected] Subject: [python-win32] taskscheduler: how to tick setting "Run task as soon as possible after scheduled start is missed" Maybe I can adjust the flag in the Trigger object but I have no idea what flags are available. [cid:[email protected]]
_______________________________________________ python-win32 mailing list [email protected] https://mail.python.org/mailman/listinfo/python-win32
