Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete Task Scheduler task at Uninstall?

My installed app creates a Task Scheduler task at run-time. This Task Scheduler task runs one of my installed apps at Windows log on. So I need to delete this Task Scheduler task at uninstall. Is the Inno Setup-Uninstaller able to do this?

OS: Win 7/8/10 x64

like image 517
user1580348 Avatar asked Mar 05 '23 12:03

user1580348


1 Answers

Run schtasks /Delete from [UninstallRun] section:

[UninstallRun]
Filename: "schtasks"; Parameters: "/Delete /TN ""My Task"" /F"; Flags: runhidden

When the task does not exist, the command does nothing.


This is similar to creating a task with Inno Setup.

like image 196
Martin Prikryl Avatar answered May 09 '23 04:05

Martin Prikryl