Hide C# Console App Window When Started by Task Scheduler

可紊 提交于 2019-12-11 03:30:05

问题


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


回答1:


Change the output type to Windows application will solve your problem

Goto : Project - >Project Properties




回答2:


Check Hidden checkbox, and check the "Run whether user is logged on or not" check box and executable will run in the background.


回答3:


If you have access to the code/solution, On ProjectProperties set Output Type as Windows Application.




回答4:


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.




回答5:


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




回答6:


You can simply check the checkbox that says 'Hidden' in the 'General' tab of the Task scheduler if you want a quick fix.



来源:https://stackoverflow.com/questions/15745195/hide-c-sharp-console-app-window-when-started-by-task-scheduler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!