如何设置 Windows 计划任务在后台运行?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6568736/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I set a Windows scheduled task to run in the background?
提问by Samuel Liew
Does anyone know how to set a scheduled task to run in background using Windows Task Scheduler?
There doesn't seem to be any option to do this.
有谁知道如何使用 Windows 任务计划程序将计划任务设置为在后台运行?
似乎没有任何选择可以做到这一点。
回答by Samuel Liew
As notedby Mattias Nordqvistin the comments below, you can also select the radio button option "Run whether user is logged on or not". When saving the task, you will be prompted once for the user password. bambamsnotedthat this wouldn't grant System permissions to the process, and also seems to hide the command window.
正如Mattias Nordqvist在下面的评论中所指出的,您还可以选择单选按钮选项“无论用户是否登录都运行”。保存任务时,系统将提示您输入用户密码。bambams指出,这不会授予该进程的系统权限,而且似乎还隐藏了命令窗口。
It's not an obvious solution, but to make a Scheduled Task run in the background, change the Userrunning the task to "SYSTEM", and nothing will appear on your screen.
这不是一个明显的解决方案,但要在后台运行计划任务,将运行任务的用户更改为“系统”,并且屏幕上不会显示任何内容。
回答by Jay Sidri
Assuming the application you are attempting to run in the background is CLI based, you can try calling the scheduled jobs using Hidden Start
假设您尝试在后台运行的应用程序是基于 CLI 的,您可以尝试使用Hidden Start调用计划作业
Also see: http://www.howtogeek.com/howto/windows/hide-flashing-command-line-and-batch-file-windows-on-startup/
另请参阅:http: //www.howtogeek.com/howto/windows/hide-flashing-command-line-and-batch-file-windows-on-startup/