[英]Hide C# Console App Window When Started by Task Scheduler
I have searched google for this and read some resources but I wasn't able to find a good answer. 我搜索谷歌这个并阅读一些资源,但我找不到一个好的答案。 Does anyone know how to prevent the console app window from opening when it is started by the task scheduler? 有没有人知道如何防止控制台应用程序窗口在任务计划程序启动时打开?
Ref. 参考。 https://www.google.com/search?q=task+scheduler+hide+console+window&aq=f&oq=task+scheduler+hide+console+window&aqs=chrome.0.57j0l2j62.7404&sourceid=chrome&ie=UTF-8 https://www.google.com/search?q=task+scheduler+hide+console+window&aq=f&oq=task+scheduler+hide+console+window&aqs=chrome.0.57j0l2j62.7404&sourceid=chrome&ie=UTF-8
Change the output type to Windows application
will solve your problem 将output type to Windows application
更改output type to Windows application
将解决您的问题
Goto : Project - >Project Properties 转到:项目 - >项目属性
Check Hidden checkbox, and check the "Run whether user is logged on or not" check box and executable will run in the background. 选中隐藏复选框,然后选中“运行用户是否登录”复选框,可执行文件将在后台运行。
如果您有权访问代码/解决方案,On ProjectProperties将输出类型设置为Windows应用程序 。
As a simple partial solution, you can start your application minimized from a task scheduler. 作为一个简单的部分解决方案,您可以从任务计划程序中最小化应用程序。
start /min <full path to your app>.exe
It would be present in task bar, but it's main window would not be visible unless user clicks it in the task bar. 它将出现在任务栏中,但除非用户在任务栏中单击它,否则它的主窗口将不可见。
如果要快速修复,只需在任务计划程序的“常规”选项卡中选中“隐藏”复选框即可。
Set " Run only when user is logged in " to be visible . 设置“ 仅在用户登录时运行 ”才可见 。 Set " Run whether user is logged on or not " to be always hidden regardless of the setting of the "Hidden" checkbox. 无论“隐藏”复选框的设置如何,设置“ 运行是否登录用户 ”都将始终隐藏 。
See http://technet.microsoft.com/en-us/library/cc722152.aspx 请参阅http://technet.microsoft.com/en-us/library/cc722152.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.