INFO: Starting and Stopping Services from the Command Prompt (320907)



The information in this article applies to:

  • Microsoft Windows CE .NET Operating System

This article was previously published under Q320907

SUMMARY

Windows CE .NET includes a services loader that loads and manages various server applications. You can access this services subsystem three ways: programmatically, through the registry, and from the command prompt. This article contains more information about using services from the command prompt on Windows CE .NET.

MORE INFORMATION

You can run the Services.exe program from the command prompt by using the following format:

services [flags] [command [service]]

Commands

  • help - print a short description of the commands that help supports
  • list - list loaded services
  • load <service name> - activate a service that is inactive
  • stop <service instance> - stop/pause a service (does not unload)
  • start <service instance> - start/resume a service
  • refresh <service instance> - cause service to refresh its config
  • unload <service instance> - cause service to be unloaded and removed
  • register <service name> - automatically load the service on next restart
  • unregister <service name> - do not automatically load the service on next restart

Where

  • <service name> - the name of the service in the registry (for example, HTTPD)
  • <service instance> - particular instantiation (for example, HTP0:)

Flags

  • -f<file name>
  • -s silent
  • -d output to debugger
The following is an example of the output for the list command:

Instance        Handle          Path            Status
HTP0:           0x000300e0      HTTPD.DLL       Running
OBX0:           0x000304a0      OBEXSrVr.dll    Off
MMQ1:           0x000325d0      MSMQD.Dll       Off
					

NOTE: The service name is the name that you use to register the service with Services.exe. You can register with Services.exe either in the registry (HKLM\Services\[service name]), or by means of the RegisterService function. Unlike some other operating systems, you cannot use this function to start a typical application as a service.

For more information about services, see the Platform Builder 4.0 documentation, which includes information about the services registry settings and how to programmatically create and work with services.

Modification Type:MinorLast Reviewed:12/27/2003
Keywords:kbinfo KB320907