CMD sc.exe Add a service take MongoDB as an example

Source: Internet
Author: User
Tags create mongodb

-----

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.