Possible Duplicate:
How can a WPF application be launched before I logon to Windows?
I have written a application in C#. I want to run my application before logging into Windows OS (after Windows OS pre-loading). How can I do that?
Possible Duplicate:
How can a WPF application be launched before I logon to Windows?
I have written a application in C#. I want to run my application before logging into Windows OS (after Windows OS pre-loading). How can I do that?
The only way to do this is to create a Windows Service instead of an application. Since services are not user-mode applications, they are allowed to run even when no user is logged in.
However, this has other caveats. Most developers learn only the above and think that they need to write a Windows Service. This is incorrect: in reality, it is quite rare that you ever actually need to write one of these. As mentioned above, they are not user-mode applications and therefore cannot show any type of user interface. They are designed only to run in the background and for instances where the user does not need to interact with them in any way, other than [rarely] stopping and starting them.
If you already have a regular application with a user interface, then creating a Windows Service is not an option for you. Your application will not port to a service, and you'll be back asking half a dozen questions about seemingly unexplained behavior, system crashes, and the inability to do various things. A service is not a replacement for an application: it's an entirely different product that requires a completely different design methodology.
So what are your options? Well, basically nothing. Windows is a multi-user operating system. There is no way to run a user-mode application without a user logged in. The best thing that you can do is to add your application to the "Startup" folder shared by all user accounts, and then configure the machine to automatically log in a particular user when it starts up. That way, there will never be a time that the computer is running without a user logged in, and therefore without your application running as well.
In order to do this, you'll need to configure Group Policies on the computers, which will require you to have administrative access to them and will not work on computers which you do not own (such as machines that belong to customers). That's actually a good thing, because this is extremely poor design for an application intended for general use.
Ask more questions about setting up Group Policies over on our sister site designed for system administrators, Server Fault.
It would have to be a Service to run before login.
It need to be a Windows service and the service needs to be installed/configured as "automatic startup"