Registry an application as system services

  • Thread starter ºa¤Ö@¤½¥q
  • Start date
º

ºa¤Ö@¤½¥q

Hi All,

I have developed a command mode application which implemented by Visual
Basic 6.0

And only thing the program would do is read a specificed folder and move
that folder's content to other folder.

I have added a new key under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

And added several value such as
Description
DisplayName
ErrorControl
ImagePath
Start
Type
ObjectName

However, when I tried to start up the services, the system prompt me
Error 1053, it sees my program have provide reply to the system,
what can I do?

Thanks
 
M

Mark V

In said:
Hi All,

I have developed a command mode application which implemented by
Visual Basic 6.0

And only thing the program would do is read a specificed folder
and move that folder's content to other folder.

I have added a new key under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\

And added several value such as
Description
DisplayName
ErrorControl
ImagePath
Start
Type
ObjectName

However, when I tried to start up the services, the system
prompt me Error 1053, it sees my program have provide reply to
the system, what can I do?

The only thing I can add here is that "services" must be
*installed* by the SCM (Service Control Manager) usually.
Otherwise, I have no idea about your code or the ability to run
your program as a Service. The Resource Kit has tools like
srvany.exe that may help. Or a VB group may be helpful too.

For the stated purpose it seems to me that a Service is entirely
unnecessary. A System Start-Up Script (batch file) may be quite
sufficient.
 
J

Jon Wallace

To clarify...

A service is in essence like any other executable, for example NOTEPAD.EXE
can run as a service. The main difference is that a service executable has
some additional code which allows it to talk to the service control manager
(SCM) - your executable won't have this code.

As Mark said you will have to use another tool such as SRVANY.EXE in the
resource kit to 'wrap' your service. What actually happens here is that
SRVANY.EXE is the service executable which then calls your executable once
loaded.

If you simple put your executable into the registry, it will start but after
around 5 seconds the SCM will find it has not had a reply from the service
and therefore terminate it.

What you might also want to do is to check out the MSDN site for a service
example or skeleton.

I also agree with Mark's comments regarding why do you want this to be a
service...

Hope it helps.

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top