Go SC Command---Install, open, configure, and close the Windows Service Bat batch

Source: Internet
Author: User

This article was reproduced from: http://blog.csdn.net/moruna/article/details/9190733

Don't say much nonsense, look at the command line more directly!

First, the direct use of CMD to service some of the operation

1. Installation Services

SC create test3 binpath= "C:\Users\Administrator\Desktop\win32srvDemo\win32srvdemo\Debug\win32srvDemo.exe"

Where: Test3 is the name of the service created, and BinPath is followed by the path where the exe file is run

2. Configuration Service

There are the following centralization methods:

sc config service name Start=auto (automatic)

sc config service name start= DEMAND (manual)

sc config service name start= DISABLED (disabled)

For example, the following command will start automatically on the XP system:

sc config test3 start= AUTO  

3. Open Service

net start Test3  

4. Close the service

net stop Test3  

5. Delete Service

SC Delete Test3  

Second, for the convenience of use, can be edited as a bat batch file

(Create a new TXT file, name it yourself, and change the suffix to. bat file)

1. Create, configure, and open services

@echo. Service startup  ... @echo off  @sc create Test3 binpath= "C:\Users\Administrator\Desktop\win32srvdemo\win32srvdemo\Debug\ Win32srvdemo.exe "  @net start test3  @sc config test3 start= AUTO  @echo off  @echo.  @pause  

2. Close the service

@echo. Service off  @echo off  @net stop test3  @echo off  @echo. Close the end!  @pause

3. Delete Service

@echo. Service removal  @echo off  @sc Delete test3  @echo off  @echo. Delete End!  @pause

Third, about SC

can refer to a Netizen's blog---SC Command Management Service Status: http://blog.csdn.net/ddjj_1980/article/details/7493045

Go SC Command---Install, open, configure, and close the Windows Service Bat batch

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.