Thursday, 29 August 2013

How to install a windows service from command line specifying name and description?

How to install a windows service from command line specifying name and
description?

I created a Windows service with Delphi for a client server application.
To install it I use
c:\Test\MyService.exe /install (or /uninstall)
This installs the service and in Windows services it lists with
"MyService" name and empty description.
How to define a different name and insert a description (to be seen when
running services.msc)?
Note: I need this because on the same machine i need to install more times
the same service (1 per database).
Currently the only workaround i foudn is to rename the service exe, but
I'd prefer to find out the correct command line way to do it (since I do
this from ShellExecute).
Update: Somehow i'd look for something like (this is just for explanation
reasons of course! - InstallService.exe is a name i just invented):
InstallService.exe c:\Test\MyService.exe /install /name='MyService1'
/description='This is my service for database 1'

No comments:

Post a Comment