Link to home
Start Free TrialLog in
Avatar of alexking
alexkingFlag for United Kingdom of Great Britain and Northern Ireland

asked on

How do I run a vb.net windows application from a vb.net Service?

I am totally new to Windows Services and I need to write one in vb.net that simply calls a vb.net Windows application. The Windows App is a small program that runs continuously, monitoring messages and running timed reports. It has a user interface for the administrator to just show the event log and so you can see when the next timed event will be.

I need this app to always be running on the server even when the administrator has logged off and it needs to always start again if the server has been restarted for any reason, hence I thought a service that calls it would be the best way to do it.

I have created a vb.net Windows Service project, added a service installer, set the starttype to automatic but I am not sure where or how to "shell" to my app (Process.start I think?)

Any help would be much appreciated!
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alexking

ASKER

I'm following this through, have created something simple that just uses:

        System.Diagnostics.Process.Start("MyApp.exe")

as the samples seemed to dive into C++ which I am not using and am not familiar with, but am now struggling to install it using the link to http://www.dotheweb.net/articles/dotnet/services4.aspx - i have created an installer but when I install on the target server I am asked to "set service login", username and password dialogue box. I enter my login and password (I am logged in as administrator)  but it says "The account name is invalid or does not exist or the password is invalid for the account name specified" - it isn't, it is my main administrator account that I am logged in as!!
Just found changing ProcessInstaller account to LocalSystem gets rid of this dialogue so trying again :)