加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

windows-7 – Windows 7中是否支持ITaskScheduler?

发布时间:2020-12-14 02:16:21 所属栏目:Windows 来源:网络整理
导读:Windows 7是否支持 ITaskScheduler ? 我已经使用Windows XP和Windows Vista中的任务计划程序来创建计划任务. 在Windows 7上,(正确)创建作业,例如: C:WindowsTasksFoo Test Task.job 但任务永远不会运行,也不会出现在任务计划程序UI(开始 – 任务计划程
Windows 7是否支持 ITaskScheduler

我已经使用Windows XP和Windows Vista中的任务计划程序来创建计划任务.

在Windows 7上,(正确)创建作业,例如:

C:WindowsTasksFoo Test Task.job

但任务永远不会运行,也不会出现在任务计划程序UI(开始 – >任务计划程序)中:

注意:根据MSDN,ITaskScheduler是现已弃用的Task Scheduler 1.0 API的一部分.新应用程序应使用ITaskService,Task Scheduler 2.0的一部分.

由于ITaskScheduler在Windows 7下不起作用(对我而言)(但在Windows Vista下工作)我想知道它是否不再受支持(即使存在COM对象,代码也不会导致错误,并且它会创建作业).

虽然MSDN在Task Scheduler 1.0支持的操作系统列表中不包含Windows 7,但它甚至没有说Windows 7支持Task Scheduler 2.0:

07002

The Task Scheduler requires the
following operating systems.

  • Task Scheduler 1.0: Client requires
    Windows Vista,Windows XP,Windows
    2000 Professional,Windows Me,or
    Windows 98. Server requires Windows
    Server 2008,Windows Server 2003 or
    Windows 2000 Server.
  • Task Scheduler 2.0: Client requires Windows Vista. Server requires Windows Server 2008.

因此,Windows 7上正式支持任务调度程序API.

但是Windows 7上是否支持ITaskScheduler?

它有望起作用吗?

根据社区对Task Scheduler homepage的评论,我猜不是:

Task Scheduler 1.0 under Windows Vista,Windows 7 etc.
Is it really possible to use Task Scheduler 1,0 under Windows Vista and Windows 7? How can it be done?

Task Scheduler work-around for Win7
I have the same trouble with Win7 Task Scheduler – Creating a simple task to launch a script/program does not work.

I exported my non-working task as well
as a working MS task and compared
them. I changed the following
parameter in my exported task and
re-imported it and now it works:
<UseUnifiedSchedulingEngine>true</UseUnifiedSchedulingEngine>

This work-around is getting me by for
now.

Other thoughts: There does not appear
to be a Task Scheduler GUI setting to
affect this parameter? The API
description implied a setting of false
should work,but for some reason it
doesn’t? It’s hard to believe such a
fundemental overshight exists; could
it be something else with my Win7
setup that requires the true setting?
I seem to recall the same problem with
a fresh Vista install in the past that
was mysteriously resolved before I
investigated a work-around. Hmmm… I
think I read also that the new
scheduling engine associated with the
true setting curiously does not
support things like monthly
scheduling….?

Task Schedule in Windows 7 fails but
works in Windows XP Pro

I have a
scheduled task that executes perfectly
well in Windows XP Pro but the same
task in Windows 7 returns a “0x2”
under “Last Run Result”. According to
the command line command,“net helpmsg
2”,“0x2” equates to “The system
cannot find the file specified.”

I can certainly find the file,and the
path I use in the Actions tab has been
checked,re-checked,double-checked
and triple-checked.

I have read countless posts in
multiple forums about this issue. I
have yet to find a satisfactory
answer.

The action that the task is supposed
to execute is a .bat file that calls a
Perl script. The Perl script writes
one each of the following file types,
.txt,.csv,and .xml. Execution of the
.bat file from the command line works
perfectly well; however,once it is
put into a Windows 7 scheduled task,
it returns 0x2. This same task under
Windows XP Pro works like a champ.
What is it about Windows 7 tasks that
make it so difficult to execute
successfully?

解决方法

在Vista之后,您需要使用Task Scheduler 2.0接口而不是1.0.部分可以处理旧调度程序应用程序的w7,但之间存在很多差异.

如果需要创建跨平台(xp / vista / w7 / w8)调度程序,则需要处理操作系统版本和接口.很多额外的工作,但比使用旧界面创建一个解决方案更好.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读