Discussion Locked

VB program running as a Service.

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a VB program that copies some files from one server to another, also accessing an FTP site.
I have a Form which contains Timer, Inet, Winsock and SMTP controls.
I set it up to run as a Service using SRVANY.EXE .
You can start the service manually OK, but it does not start automatically at the server startup, even though it is set up to start automatically.
Is it because it has a Form?
Or what is the problem?
Thanks.
Alex.

3 replies

by glen_mcleod

2 things to consider:

Yes, the form can stop this from working as a service. There really shouldn't be ANY user interface elements to things that you want to run as a scheduled service. You can code directly to the interfaces (references) instead of the controls that require a form.

Under your project's properties, there's a check box for 'unattended execution'. Check it.

Glen

by ablokh

Glen, thanks for the answer.
One point: unattended execution box is disabled in the project properties.
I tried to delete the Form from the project, shanging startup object to Sub Main in my Standard .EXE project, but the result is the same.
Whatcauses the check box to be disabled?

This discussion is closed to new replies.