-----
Describe:
Create a service item in the Registry and service database.
Usage:
SC <server> Create [service name] [binpath=] <option1> <option2> ....
Options:
Note: The option name includes the equals sign.
A space is required between the equals sign and the value.
Type= <own|share|interact|kernel|filesys|rec|userown|usershare>
(default = Own)
Start= <boot|system|auto|demand|disabled|delayed-auto>
(default = Demand)
Error= <normal|severe|critical|ignore>
(default = Normal)
binpath= <.exe File binarypathname>
group= <LoadOrderGroup>
tag= <yes|no>
depend= < Dependencies (separated by/(slash)) >
obj= <accountname| Objectname>
(default = LocalSystem)
Displayname= < display name >
password= < password >
---------
Steps:
1. Run as Administrator: C:\Windows\System32\cmd.exe
2. Input: Sc.exe create MongoDB binpath= "\" c:mongo\bin\mongod.exe\ "--service--config=\" c:mongo\mongod.cfg\ "" Displayname= "MongoDB" start= "Auto" (these few quotes are important)
3. Appearance: [SC] CreateService success
4. Enter: Net start MongoDB
5. Advent: MongoDB service is starting.
MongoDB Service has started successfully.
--------
Ctrl+r then enter Service.msc to see the added service.
CMD sc.exe Add a service take MongoDB as an example