此命令应创建一个每分钟运行计算器窗口应用程序的任务.
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.