Windows 7计划任务命令行

此命令应创建一个每分钟运行计算器窗口应用程序的任务.

schtasks /Create /tn "mytask" /sc MINUTE /mo 1  /ru "myuser" /rp "mypassword" /tr "C:\Windows\System32\calc.exe"

它运行正常,任务被添加.任务看起来正确.任务显示为在计划中启动,但计算器不会被激活. exe存在,我可以单独运行它.

有谁知道我为什么看不到计算器?

解决方法

可能是因为任务没有以交互方式运行. Add the ‘/it’ option

/IT
A value that enables the task to run interactively only if the
/RU user is currently logged on at the time the task runs. The task
runs only if the user is logged on.

如果没有/ it选项,任务将在会话0中运行,这不允许与用户进行交互.有关更多信息,请在Web上搜索“会话0隔离”.

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...