我正在使用Windows任务计划程序在用户login时启动提升的pipe理员程序。 该技术基于这篇文章:
http://www.sevenforums.com/tutorials/11949-elevated-program-shortcut-without-uac-prompt-create.html
注:高级pipe理员程序是一个自动化testing程序,需要以pipe理员身份运行以安装程序并运行各种testing。 某些testing需要pipe理员权限并访问桌面。
如本文所述,将任务configuration为以高于正常优先级的方式运行:
https://stackoverflow.com/questions/2427142/is-there-any-way-for-a-win2k8-scheduled-task-to-have-normal-priority-io
在Windows Vista,Windows 7和Windows Server 2008上一切正常。
在Windows 8和Windows Server 2012上,testing程序的性能非常糟糕,通常需要运行5-10次。 CPU使用率和磁盘I / O都非常高。 Process Hacker( http://processhacker.sourceforge.net/ )显示I / O优先级为正常,页面优先级为正常。
如果testing程序在login期间由任务计划程序运行,则性能较差。 如果我停止testing程序并通过手动运行任务计划程序任务重新启动它,则会恢复正常的性能。
以下是testing程序的一个简化版本的一些数字:
任何帮助,将不胜感激。
我想我有解决这个问题的办法。 它看起来像Windows 8和Windows Server 2012上的计划任务的行为取决于任务启动时的login顺序。
我的testing任务有一个内置的延迟。任务在login序列的早期启动,暂停60秒,然后开始testing运行。 尝试了各种延迟,但在所有情况下,Windows 8和Windows 2012的性能都很糟糕。 注意:testing任务在几乎干净的Windows安装中运行,所以60秒足以超过login顺序。
我更改了testing任务以删除内置的延迟,而是使用任务计划程序的启动延迟function。 在Windows 8和Windows Server 2012上,testing任务configuration为在login后启动60秒。 在这个改变之后,testing任务正常运行。
我已经search了MSFT文档的这种行为的解释,但到目前为止画空白。
我非常感谢@ charleswj81,@MDMarra和@Daniel Goldberg。 您的意见帮助我从不同的angular度来看问题,并最终找出解决办法。