问题
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:

回答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