简体   繁体   English

任务计划程序启动时隐藏C#控制台应用程序窗口

[英]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.

相关问题 从任务计划程序运行时,Windows服务器上的计划的C#控制台应用程序不显示控制台 - Scheduled c# console app on windows server does not show console when ran from task scheduler 带有任务计划程序的C#控制台应用程序退出代码 - C# Console App Exit Code with Task Scheduler C#为什么我不能以编程方式杀死在Task Scheduler中启动的控制台程序? - C# Why can I not programmatically kill a console program started in Task Scheduler? 如何使用Windows Task Scheduler隐藏控制台应用程序窗口 - How to hide console application window with windows task scheduler 具有Excel Interop的C#控制台应用程序作为Windows计划程序/ ActiveBatch上的计划任务挂起 - C# Console App with Excel Interop hangs as a scheduled task on Windows scheduler/ActiveBatch 如何从任务管理器启动的 C# Windows 应用程序中显示控制台 output? - How do you show console output from C# Windows app started by task manager? C#中的任务计划程序 - Task Scheduler in c# 任务计划程序定期停止运行C#控制台应用程序 - Task scheduler stops running C# console application periodically 设置为“启动时”时,控制台应用程序无法通过任务计划程序启动 - Console app not launching via task scheduler when set to "At StartUp" 从Windows Task Scheduler运行控制台应用程序时遇到CryptographicException - Encountering a CryptographicException when console app is run from Windows Task Scheduler
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM