Windows 7 计划任务命令行 [英] Windows 7 Scheduled task command line

查看:56
本文介绍了Windows 7 计划任务命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

This command should create a task that every minute runs the calculator windows application.

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

它运行正常,任务被添加.任务看起来不错.任务在计划中显示为已开始,但计算器并未启动.exe存在,我可以单独运行.

It runs OK, the tasks gets added. The task looks right. The tasks shows as started in the schedular but the calculator does not get fired up. The exe exists, I can run it separately.

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

Anyone know why I don't see the calculator?

推荐答案

可能是因为任务没有以交互方式运行.添加/it"选项:

Probably because the task isn't running interactively. Add the '/it' option:

/IT
一个值,仅当/RU 用户当前已在任务运行时登录.任务仅在用户登录时运行.

/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 中运行,这不允许与用户交互.有关详细信息,请在网络上搜索会话 0 隔离".

Without the /it option, tasks run in session 0, which doesn't allow interaction with the user. For more information, do a web search for "Session 0 isolation".

这篇关于Windows 7 计划任务命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆