Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Problems With App As Windows Service

Recommended Posts

So I have this little program that has a server side and a client side. Basically, the client side just connects to the server, and then closes. The server, when it gets a request, runs through a script that maps a couple drives, deletes old files, then copies a new one, then disconnects the drives and writes a log.When I run this as a normal application, it works fine. I found a tutorial on making it a service, and it shows up and everything, but it doesnt do anything. All the permissions are right, so I don't have a clue what the deal is.Does anyone know an easy way to make a program act as a service in vb 6?__________________

Share this post


Link to post
Share on other sites

i dont think VB programs can be directly run as a service, what you could do instead is just add it to the registry under startup ( HKCU > Software > Microsoft > Windows > current version > run ) and it will startup and run fine

Share this post


Link to post
Share on other sites

If you just want to run your application on startup, an alternative is to place it's shortcut in "C:\Documents and Settings\%USERNAME%\Start Menu\Programs\Startup".The application will simply start when you login to Windows.

Share this post


Link to post
Share on other sites

oh also, if you want it to start up for all users, not just the current logged in user, you have to add the app to

Hkey_Local_Machine > software > microsoft > windows > current version > run
if you want it to run only once, add to
Hkey_Local_Machine > software > microsoft > windows > current version > runonce
hope this helps.

Share this post


Link to post
Share on other sites

Hi all,Yes,those are very good solutions to automaticaly start an application,but what happens when that machine is not used by regular users,for example,it runs as a server,and never gets past the login screen.I thin windows doesn't process startup part of registry at this point,but waits for you to login.In this case,application wouldn't start.I wanted to try making my own service app,but never got around,so I can't be of any big help.What I can do,is tell you where you maybe should focus your attention.Maybe there is another way that services run,I do believe you need Sub Main,or something similar.Some extra piece of code that needs to be moved or so.If I get around to making application that runs as a service,I'll notify you on results.Cheers

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.