I have a couple applications that I would like to be able to add scheduled tasks from within them. I've been Googling for how to add tasks in both XP and Vista. Apparently, Vista has a new Task Scheduler that is very different from the one in XP.
我有几个应用程序,我希望能够从其中添加计划任务。我一直在谷歌搜索如何在XP和Vista中添加任务。显然,Vista有一个新的任务调度程序,与XP中的不同。
Does anybody know if there is a single API to tackle both of them, or do I have to code for both in my apps?
有没有人知道是否有单一的API来解决它们,或者我是否必须在我的应用程序中为两者编码?
4 个解决方案
#1
4
I think you could use the Task Scheduler COM interface.
我想你可以使用Task Scheduler COM接口。
Also check out this project.
还看看这个项目。
#2
0
If I recall correctly, the initial release of Vista used the same API as XP.
如果我没记错的话,Vista的初始版本使用了与XP相同的API。
Server 2008 is supposed to have a much improved scheduler. That would seem to indicate that the API has changed.
Server 2008应该具有更好的调度程序。这似乎表明API已经改变。
I mention 2008 because SP1 for Vista brought much of the code in line with Server 2008.
我提到2008年,因为SP1 for Vista带来了大部分与Server 2008一致的代码。
Good luck and I'll be watching other answers.
祝你好运,我会看到其他答案。
#3
0
Ideally, you could use the interface on the OS you're currently running on. You could do this by having an XP and Vista version of your app, for instance.
理想情况下,您可以使用当前运行的操作系统上的界面。例如,您可以通过拥有应用程序的XP和Vista版本来实现此目的。
But Vista is from Microsoft, so the old API is still there for programs to use. The simplest solution is to use the XP API for this version of your app, and require Vista, Server 2K8 or better in the next version or perhaps 2 versions from now and transition to the Task Scheduler 2.0 API then.
但Vista来自微软,所以旧的API仍然可供程序使用。最简单的解决方案是在此版本的应用程序中使用XP API,并在下一版本中使用Vista,Server 2K8或更高版本,或者从现在开始需要2个版本,然后转换到Task Scheduler 2.0 API。
#4
0
Just as I suspected. I will have to code to two different APIs then. It will make maintenance harder, but not impossible. Just need to make sure that I put integration test that cover both cases.
就像我怀疑的那样。我将不得不编写两个不同的API代码。它会使维护更难,但并非不可能。只需要确保我进行了涵盖两种情况的集成测试。
#1
4
I think you could use the Task Scheduler COM interface.
我想你可以使用Task Scheduler COM接口。
Also check out this project.
还看看这个项目。
#2
0
If I recall correctly, the initial release of Vista used the same API as XP.
如果我没记错的话,Vista的初始版本使用了与XP相同的API。
Server 2008 is supposed to have a much improved scheduler. That would seem to indicate that the API has changed.
Server 2008应该具有更好的调度程序。这似乎表明API已经改变。
I mention 2008 because SP1 for Vista brought much of the code in line with Server 2008.
我提到2008年,因为SP1 for Vista带来了大部分与Server 2008一致的代码。
Good luck and I'll be watching other answers.
祝你好运,我会看到其他答案。
#3
0
Ideally, you could use the interface on the OS you're currently running on. You could do this by having an XP and Vista version of your app, for instance.
理想情况下,您可以使用当前运行的操作系统上的界面。例如,您可以通过拥有应用程序的XP和Vista版本来实现此目的。
But Vista is from Microsoft, so the old API is still there for programs to use. The simplest solution is to use the XP API for this version of your app, and require Vista, Server 2K8 or better in the next version or perhaps 2 versions from now and transition to the Task Scheduler 2.0 API then.
但Vista来自微软,所以旧的API仍然可供程序使用。最简单的解决方案是在此版本的应用程序中使用XP API,并在下一版本中使用Vista,Server 2K8或更高版本,或者从现在开始需要2个版本,然后转换到Task Scheduler 2.0 API。
#4
0
Just as I suspected. I will have to code to two different APIs then. It will make maintenance harder, but not impossible. Just need to make sure that I put integration test that cover both cases.
就像我怀疑的那样。我将不得不编写两个不同的API代码。它会使维护更难,但并非不可能。只需要确保我进行了涵盖两种情况的集成测试。