Hide C# Console App Window When Started by Task Scheduler

10,632

Solution 1

Change the output type to Windows application will solve your problem

Goto : Project - >Project Properties

enter image description here

Solution 2

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

Solution 3

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.

Solution 4

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

Solution 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

Share:
10,632
user1477388
Author by

user1477388

Authored open-source project PHP One, an MVC framework for PHP designed like Microsoft's ASP.NET MVC. https://github.com/DominicArchual/Php-One

Updated on June 04, 2022

Comments

  • user1477388
    user1477388 almost 2 years

    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

  • user1477388
    user1477388 about 11 years
    How do I declare this via the Task Scheduler UI?
  • user1477388
    user1477388 about 11 years
    Thanks for the screenshot; but how will that solve the problem? Will it run it minimized or will it run in the background or something?
  • alex
    alex about 11 years
    Just type it into executable program textbox. If "start" would not work by itself, try executing it in a command line interpreter. like this: cmd /c start /min <full path to your app>.exe
  • Pandian
    Pandian about 11 years
    @user1477388: It runs like normal but it does not show any screens on front end..
  • user1477388
    user1477388 about 11 years
    You answered this 6 minutes before the other guy, but he included a screenshot which would probably be helpful to other users who may find this resource. Thanks.
  • Wasted_Coder
    Wasted_Coder over 3 years
    The "Hidden" option on the task, will only hide the task in the task manager GUI. It does nothing to how the Actions are executed. (You can view Hidden Tasks by View > Show Hidden Tasks).