• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 310
  • Last Modified:

Scheduler

How can I add a new Scheduled Task to the Windows Scheduler from VB.NET 2003? And how can I bring up the "Scheduled" and "Settings" tab of a Scheduled Task from my app, like is done when you schedule a Backup using Windows Backup Utility?

Thanks
0
SETP
Asked:
SETP
  • 5
  • 2
1 Solution
 
PaulHewsCommented:
Here is a nice component I've been using in my programs:
Task Scheduler Library for .NET
A library for .NET that encapsulates the Task Scheduler COM object
http://codeproject.com/csharp/taskschedulerlibrary.asp?df=100&forumid=3181&exp=0&select=703401
0
 
PaulHewsCommented:
Looks like there's a newer version:
http://www.codeproject.com/csharp/TSNewLib.asp
0
 
SETPAuthor Commented:
Thanks, I will check it out.

Any ideas how I can bring up the "Scheduled" and "Settings" tab of a Scheduled Task from my app, like is done when you schedule a Backup using Windows Backup Utility?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
PaulHewsCommented:
That library has a method to show the tabs.

Dim TaskSched As New TaskScheduler.ScheduledTasks
Dim Name As String = "My New Task"
Dim Task As TaskScheduler.Task = TaskSched.CreateTask(Name)

Task.ApplicationName = "Notepad.exe"
Task.SetAccountInformation("username", "password")
Task.DisplayForEdit()
Task.Save()
Task.Close()
0
 
PaulHewsCommented:
This would be better, as it only shows the Tabs you requested:

Dim TaskSched As New TaskScheduler.ScheduledTasks
Dim Name As String = "My New Task"
Dim Task As TaskScheduler.Task = TaskSched.CreateTask(Name)

Task.ApplicationName = "Notepad.exe"
Task.SetAccountInformation("username", "password")
If Task.DisplayPropertySheet(TaskScheduler.Task.PropPages.Schedule Or TaskScheduler.Task.PropPages.Settings) = True Then
    Task.Save()
End If
Task.Close()
0
 
SETPAuthor Commented:
Thanks PaulHews - that was exactly what I needed!
0
 
PaulHewsCommented:
Glad to help, thanks for the points and the grade.  :)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now