So I worked on the code a bit and so far the best way I came up with was this:
Public Sub newTask()
' Create a new task definition and assign properties
Dim td As TaskDefinition = _tskSrvc.NewTask
td.RegistrationInfo.Description = ""
' Add an action (shorthand) that runs Notepad
td.Actions.Add(New ExecAction("notepad.exe", "c:\test.log"))
' Register the task in the root folder
_rootFolder.RegisterTaskDefinition("THISISNTANEWTASK", td)
Dim dlg As New TaskEditDialog(_rootFolder.Tasks("THISISNTANEWTASK"), True, True)
_rootFolder.DeleteTask("THISISNTANEWTASK")
dlg.TaskName = InputBox("Please enter name of Task")
If dlg.ShowDialog() = vbOK Then
_rootFolder.RegisterTaskDefinition(dlg.TaskName, dlg.TaskDefinition)
End If
End Sub
Hope this helps somebody else.