任务调度程序在注销和登录后无法显示应用程序的 GUI(无论用户是否登录都运行) [英] Task scheduler can't show GUI of the application after logout and login (run whether user is logged on or not)

查看:51
本文介绍了任务调度程序在注销和登录后无法显示应用程序的 GUI(无论用户是否登录都运行)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 GUI 应用程序,我希望它在重新启动/注销 Windows 计算机后自动运行.

I have a GUI application, and I hope it auto run after reboot/logout windows computer.

这是我如何使用 Windows 任务调度程序:

Here is how I use windows task scheduler:

  1. 先运行命令创建任务:c:\Windows\System32\schtasks.exe/Create/TN taskname/XML taskname.xml/RU username/RP password/IT

  1. first run a command to create a task: c:\Windows\System32\schtasks.exe /Create /TN taskname /XML taskname.xml /RU username /RP password /IT

任务创建后,在常规选项卡中,选择了无论用户是否登录都运行"单选按钮,并且未选中不存储密码"复选框.在触发器选项卡中,我设置为每 5 分钟重复一次任务.

after the task was created, in the general tab, "Run whether user is logged on or not" radio button was selected, and "Do not store password" checkbox wasn't checked. in triggers tab, I set to repeat the task in every 5 minutes.

重新启动计算机后,它可以自动触发应用程序运行并在 5 分钟内显示 GUI.但是,如果我注销然后登录计算机,它只会触发应用程序运行而不显示GUI,我已经等待了大约10分钟,我只能在任务管理器中看到应用程序正在运行的进程.除非我手动结束任务然后运行任务,否则它会运行带有 GUI 的应用程序.

After reboot the computer, it can auto trigger the app to run and show the GUI in 5 minute. However, if I logout and then login the computer, it will only trigger the app to run without showing the GUI, I have been waiting for about 10 minutes, I can only see the process of app is running in task manager. Unless I manually end the task and then run the task, it will run the app with a GUI.

有谁知道它为什么会发生以及如何修复它?

Does anyone know why it happened and how to fix it?

谢谢,

推荐答案

这似乎是 Windows 的 TaskScheduler 的最新版本的方式.

This seems to be the way that recent versions of Windows' TaskScheduler.

根据 Microsoft(强调):

您可以指定即使在触发任务时计划运行任务的帐户未登录时也应运行任务.为此,请选择标有运行用户是否登录"的单选按钮.如果选择此单选按钮,任务将不会以交互方式运行.要使任务以交互方式运行,请选择仅在用户登录时运行单选按钮.

You can specify that a task should run even if the account under which the task is scheduled to run is not logged on when the task is triggered. To do this, select the radio button labeled Run whether user is logged on or not . If this radio button is selected, tasks will not run interactively. To make a task run interactively, select the Run only when user is logged on radio button.

本质上,如果您选择无论用户是否登录都运行",该进程将不会启动 UI.

Essentially, if you select 'Run whether user is logged on or not', the process will not start a UI.

这篇关于任务调度程序在注销和登录后无法显示应用程序的 GUI(无论用户是否登录都运行)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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