FancyPrairie
Programmer
I've written code to schedule a task to run at a specific time via the Task Scheduler. I now want to be able to delete the task from the task scheduler.
I can't seem to get the following code to work. What's wrong with my syntax?
I can't seem to get the following code to work. What's wrong with my syntax?
Code:
Dim objShell As Object
Set objShell = CreateObject("Wscript.Shell")
objShell.Exec ("schtasks /delete /tn ""MyTaskName""")
Set objShell = Nothing