Hi sir I have created task schedular using given link in the thread
I have ceated task schedular in installer class in OnAfterInstall().Its produces error as below: Error 1001.An excepion occured in the OnAfterInstall event handler of applicationName.installerClassName --> The Process cannot access the file because it is being used another process.
The code is:
Public Sub taskschedular()
Dim taskname As String = "Uninstall"
Using ts As TaskService = New TaskService
Dim td As TaskDefinition = ts.NewTask()
td.RegistrationInfo.Description = "Uninstall DBS"
td.Triggers.Add(New DailyTrigger With {.DaysInterval = 1})
td.Actions.Add(New ExecAction(IO.Path.Combine(My.Application.Info.DirectoryPath, "uninstall.bat")))
ts.RootFolder.RegisterTaskDefinition(taskname, td)
End Using
End Sub