Open
Set machine startup task ExecutionTimeLimit to unlimited#6
ExecutionTimeLimit to unlimited#6Conversation
Copilot
AI
changed the title
[WIP] Fix Capsense exit after 72 hours due to execution time limit
Set machine startup task Jun 23, 2026
ExecutionTimeLimit to unlimited
Replace the two-step PowerShell approach for setting ExecutionTimeLimit with a single schtasks /Create /XML call using a pre-built XML template. This eliminates the PowerShell dependency, avoids partial failure states, and includes ExecutionTimeLimit=PT0S in the task definition from creation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--startup enable(machine-level) created a Task Scheduler entry without an explicit execution limit, so Windows applied the default 72-hour runtime cap. This could stop Capsense silently after long uptime despite intended always-on background behavior.Startup task configuration
set_startup_task(enable: bool)to explicitly set the scheduled task’sSettings.ExecutionTimeLimittoPT0S(unlimited) immediately after task creation.Implementation detail
schtasks /Create, Capsense now invokes PowerShell to patch the task settings: