4

I want to run a console application on system start up without appearing it on display screen means i want to run a application as a background process.How to do this?

Praveen Kumar
  • 1,576
  • 8
  • 31
  • 47
  • 3
    Combine: http://stackoverflow.com/questions/674628/how-do-i-set-a-program-to-launch-at-startup and http://stackoverflow.com/questions/2763669/how-to-hide-a-console-application-in-c-sharp or alternatively http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/ea8b0fd5-a660-46f9-9dcb-d525cc22dcbd. – e_ne Jan 03 '13 at 04:30
  • 1
    you can use Windows service – Santhosh Nayak Jan 03 '13 at 04:32

3 Answers3

5

In short: The simplest way might be to schedule task to be started from your operating system. This might be the way easiest thing to set.

You may easily run it in the background with the scheduler - How to run a .Net Console App in the background

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Yusubov
  • 5,815
  • 9
  • 32
  • 69
3

You can change the output type in project properties as console Application type to Windows application type and compile it, Then it won't display any window at start up.

Praveen Kumar
  • 1,576
  • 8
  • 31
  • 47
0

Try this to hide the console window and run in 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 dont you try windows service ? windows service runs the process in background.

Umesh CHILAKA
  • 1,466
  • 14
  • 25