Service+ CL Documentation

Syntax

sp [ LIST | CONFIG | START | RESTART | STOP | PAUSE | CONTINUE | CONTROL | QUERY | CREATE | REMOVE | MODIFY | KILL | PARAMCHANGE | INTEROGATE | DEBUG | REGISTER | HELP ] 

For detailed information about a command:
sp (Command) /help

Optional parameters valid for most commands

/DOMAIN=
/Q Quiet mode. Answers yes to any confirmation message
/RUNAS=Domain\Account /RUNASPASSWORD=P

Note that the servername and servicename may contain wildcards (* and ?)

LIST Command

List service(s) status
sp LIST [[\\servername\]servicename] [/Domain=]
Example: 
sp list \\*\spooler
This will list the status of all your Spooler services on all your NT machines

CONFIG Command

Display service(s) configuration information
sp CONFIG [[\\servername\]servicename] [/Domain=]
Example: 
sp config \\*\spooler

This command will display the status of all your Spooler services on all your
NT machines

START Command

Start service(s)
sp START[=Startup Parameters] [\\servername\]servicename
Example:
sp start \\server\spooler

RESTART Command

Restart service(s)
sp RESTART[=Startup Parameters] [\\servername\]servicename
Example:
sp restart \\server\spooler

STOP Command

Stop service(s)
sp STOP [\\servername\]servicename
Example:
sp stop \\server\spooler

PAUSE Command

Pause service(s)
sp PAUSE [\\servername\]servicename
Example:
sp pause \\server\spooler

CONTINUE Command

Continue the service
sp CONTINUE [\\servername\]servicename
Example:
sp continue \\server\spooler

CONTROL Command

Send a private control code to your service
sp CONTROL=Code servicename
The code must be a value between 128 and 255
Example: 
sp control=128 myservice

QUERY Command

Query service status
sp QUERY [\\servername\]servicename [/Domain=]
The command will return an ErrorLevel that is set with the service status
ErrorLevel:
0 The service is not installed
1 The service is stopped
2 The service is starting
3 The service is stopping
4 The service is started
5 The service is continuing
6 The service is pausing
7 The service is paused
In the following example the Spooler service will be started if the service is stopped: 
sp list \\myserver\spooler
If ErrorLevel 1 sp \\myserver\spooler start

PARAMCHANGE Command

Send a PARAMCHANGE notification to indicate that service parameters should be reloaded
sp PARAMCHANGE [\\server\]servicename
The server name and the service name may contain jokers (* and ?)
Example: 
sp paramchange myservice

INTEROGATE Command

Send an INTEROGATE command to retrieve updated status information from a service. The command will return an ErrorLevel that is set with the service error code.
sp INTEROGATE [\\server\]servicename
Example:
sp interogate myservice

CREATE Command

Create a service
sp CREATE [\\servername\]servicename /PATH=Path to executable 
[/DISPLAYNAME= ]
[/ACCOUNT=Domain\User][/PASSWORD=]
[/INTERACT=1,0]
[/STARTUP=]
[/TYPE=OwnProcess,ShareProcess]
[/ERRORCONTROL=Ignore,Normal,Severe,Critical]

Example:
sp create \\server\myservice /path=c:\svcitocx\sample\service.exe

REMOVE Command

Remove the service
sp remove [\\servername\]servicename
Example:
sp remove \\server\myservice

MODIFY Command

sp MODIFY [[\\servername\]servicename]
[/ACCOUNT=Domain\User /PASSWORD=xyz]
[/STARTUP=MANUAL,AUTO,DISABLED]
[/DISPLAYNAME="Service Display Name"]
[/PATH="Service Name"]
[/DEPEND=]
[/INTERACT=1,0]
Example:
sp modify myservice /interact=1

KILL Command

Kill the service process
sp KILL servicename
Example:
sp kill spooler

The Kill command cannot be used remotly

DEBUG Command

Start the service and launch your debugger (Such as Visual C++)
sp DEBUG servicename
Example:
sp debug MyService

The Debug command cannot be used remotly

REGISTER Command

Install the registration key
sp REGISTER /ID=YourID /Key=YourKey
Example:
sp register /ID="Active+ Software" /Key=12345