2

I've a small c# application which does some sync between two libraries.

This has to run regularly, and the use of scheduled has been choosed.

So for now everything is working fine, except one thing, when the task is scheduled, I got a console windows which opens.

Is there any way(in the scheduler or in the application) to don't have any windows visible when the program is running?

My sync library can put in what I want.

(what if instead of using a console application, I create a windows application, without any windows, and the code started in the app.xaml.cs ? Is this a good idea? I've the impression this isn't the right way to do it).

Thank you!

J4N
  • 19,480
  • 39
  • 187
  • 340

3 Answers3

3

Set up the task to run as a different user, then it won't popup to the currently logged in user. You could run it as SYSTEM i.e.

Jacob
  • 41,721
  • 6
  • 79
  • 81
3

In the Project Properties window, Change the output type from Console Application to Windows Application. Your application will still run, but it will have no window at all. You might also consider making a Windows Service instead.

Edwin de Koning
  • 14,209
  • 7
  • 56
  • 74
1

Yes, using a Windows App without any windows is the way to go. You can even show a tray icon in an app without windows if that might be useful.

Andre Luus
  • 3,692
  • 3
  • 33
  • 46