How to start a console application in the Startup system without appearing on the display (background process)?

I want to run a console application at system startup, without appearing on the screen on the screen. I want to run the application as a background process. How to do it?

+4
source share
3 answers

You can change the output type in the project properties as a console application type for the Windows application type and compile it, then it will not display any window at startup.

+3
source

In short: The easiest way is to schedule a task to run from the operating system. This may be the easiest way to install.

You can easily run it in the background using the scheduler - How to start a .Net console application in the background

+5
source

Try this to hide the console window and start in the background.

[DllImport("user32.dll")] private static extern int ShowWindow(int Handle, int showState); [DllImport("kernel32.dll")] public static extern int GetConsoleWindow(); public static void HideWindow() { int win = GetConsoleWindow(); ShowWindow(win, 0); } 

why aren't you using windows? the windows service starts the process in the background.

0
source

All Articles