I have an application that I created a while ago. It's a forms based application that runs on one of our servers at work. The app works well, BUT at the moment, requires someone to manually run it, which means having the admin account always logged in, but having the server locked.

Although it's a forms based application, for the majority of the time I don't need to see the forms, so can I safely make this run as a service (by adding the appropriate code), and hiding the forms?

Also, is there some code I can put in to test whether the instance of the program was started as a service or from a user double clicking on the icon? If so, I'd like the user initiated instance to run with the forms visible.

Thanks