hbashton / hbashton/DS4Windows

Disabling the startup task leaves an orphaned task.bat behind

Open
#62 2 comments 0 reactions 1 assignee View on GitHub

@hbashton is already working on this.

Since Aug 12, 2026.

Dominant language
C#
Stars
272
Forks
10
Avg merge
13d 5h
Merged PRs (30d)
1

Description

Small one, from a downstream fork. Confirmed against main (cca03a1).

StartupMethods.WriteTaskEntry() writes a task.bat next to the executable and points the RunDS4Windows logon task at it. DeleteTaskEntry() removes the task but not the file:

public static void DeleteTaskEntry()
{
    TaskService ts = new TaskService();
    Task tasker = ts.FindTask("RunDS4Windows");
    if (tasker != null)
    {
        ts.RootFolder.DeleteTask("RunDS4Windows");
    }
}

So turning run-at-startup off, or switching from the task option to the shortcut option, leaves an orphaned task.bat in the install folder. Observed downstream as exactly that: task gone, shortcut gone, task.bat still present.

Harmless where it sits, but it is an executable launcher that outlives the feature the user just switched off, and it is one of the files a clean uninstall would want to account for.

Fix is a couple of lines: delete the file in DeleteTaskEntry() when it exists, tolerating failure (it may be locked or already gone — this runs on the disable path and must not throw).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.