Http://www.cnblogs.com/lzrabbit/p/3682510.html
MongoDB Windows environment Installation and configuration
Installation Services
SC create Svnservice binpath= "D:\subversion\bin\svnserve.exe--service-r E:\projectversion" displayname= "Svnservice" Depend= Tcpip
Delete Service
SC Delete Svnservice
Modify Configuration
sc config svnservice binpath= "d:\subversion\bin\svnserve.exe--service-r E:\projectversion" displayname= "Svnservice" Depend= Tcpip
Set to self-start
sc config svnservice start= auto
Start the service
net start Svnservice
1. Sc start
Start a service that is running.
Grammar
Sc [ServerName] Start ServiceName [servicearguments]
Parameters
Servicearguments
Specifies the service parameters that are passed to the service to be started.
The following example shows how to use the SC Start command:
(1) SC start tapisrv
(2) SC start Giveio
2. Sc stop
Sends a STOP control request to the service.
Grammar
Sc [ServerName] Stop ServiceName
Parameter: Slightly
Note
Not all services can be stopped.
The following example shows how to use the sc stop command:
(1) SC stop tapisrv
(2) SC stop Giveio
3. SC query
Gets and displays information about the specified service, driver, service type, or driver type.
Grammar
Sc [ServerName] query [ServiceName] [type= {driver | service | all}] [type= {own | share | interact | kernel | filesys | r EC | ADAPT}] [state= {active | inactive | all}] [bufsize= buffersize] [ri= resumeindex] [group= GroupName]
sc query parameters are many, here no longer introduced, detailed information visible Biaud know SC
Parameters
ServiceName
Specifies the name of the service returned by the getkeyname operation. This query parameter is not used in conjunction with other query parameters (except ServerName).
Commonly used as:
(1) SC query tapisrv
(2) SC query Giveio
4. SC Create
Create subkeys and projects for the service in the registry and in the Service Control Manager.
Grammar
Sc [ServerName] Create [ServiceName] [type= {own | share | kernel | filesys | rec | adapt | Interacttype= {own | share}}] [Start= {boot | system | auto | demand | disabled}] [Error= {normal | severe | critical | ignore}] [Binpath= Binarypathname] [Group= Loadordergroup] [Tag= {yes | no}] [Depend= Dependencies] [Obj= {accountname | ObjectName}] [displayname= displayname] [password= Password]
Parameters: function of each parameter See SC config command
The following example shows how to use the SC create command:
SC \\myserver create NewService binpath= C:\windows\system32\NewServ.exe
SC create NewService binpath=(space) C:\windows\system32\NewServ.exe type=(space) share start=(space) Auto depend= "+tdi Netbios"
SC create ccproxy binpath= c:\windows\ccproxy\ccproxy.exe type= share start= Auto
5. SC Delete
Removes the service subkey from the registry. If the service is running or another process has an open handle to the service, the service is marked for deletion.
Grammar
Sc [ServerName] Delete [ServiceName]
Parameter: Slightly
Note
Use Add or Remove Programs to remove DHCP, DNS, or any other built-in operating system services. Add or Remove Programs not only removes the registry subkey for the service, but also uninstalls the service and removes all of its shortcuts.
The following example shows how to use the SC Delete command:
SC Delete Newserv
SC Delete Ccproxy
MongoDB installs Windows XP