Mittwoch, 4. Juli 2012

Windows: Create/Delete a service

Create a new service:
sc create SERVICENAME binpath= "<path to executable> -arg1 -arg2"

The excutable is installed as a service. See my other post about building your own service. Please note that there is a space after binpath=.DIf the service needs arguments (which will be passed to the ServiceMain function), you can add them (arg1, arg2 above). Just be sure to surround the executable and the arguments with quotes.

Delete an existing service:

The service will be deleted after the next restart.

Keine Kommentare:

Kommentar veröffentlichen