I have a simple Console Project in Visual Studio that I want to run as a scheduled task but not show a console window when executing. What’s the best way to go about this?
In the initial use case, I need it to run as a Scheduled Task in Windows, but my uses for the application won’t be limited to just running as a Windows Scheduled Task, hence I need a way to not show the console window within the project/executable itself. Furthermore, I’m aware of how to start a console application from code and hide the output window. I’d rather not have to have another executable start the existing app.
The simplest way to have a console application not show its output with an existing Console Project is to convert the project to a Windows Forms application and set the start up object to the existing
Program.Main().(I did some googling before finding this resolution to my problem. I’m posting the question/answer in case it will someone else. Also, maybe there’s a better way than this?)