SC command --- install, enable, configure, and disable the cmd command line and bat batchcompute windows Service, scbat

Source: Internet
Author: User

SC command --- install, enable, configure, and disable the cmd command line and bat batchcompute windows Service, scbat

1. cmd command line-perform Windows service operations

 

1. Install the service

SC create service name binPath = "C: \ Users \ Administrator \ Desktop \ win32srvDemo \ win32srvdemo \ Debug \ win32srvDemo.exe"

Note: Service name: the name of the created Windows service.

BinPath: the path of the Windows service program.

2. Configure the service

SC config service name start = AUTO

Note: start = AUTO (automatic)

Start = DEMAND (manual)

Start = DISABLED (DISABLED)

3. enable the Service

Net start service name

4. Close the service

Net stop service name

5. delete a service

SC delete service name

 

Ii. bat batch processing-perform Windows service operations

(Create a txt file and change the suffix to the. bat file)

1. Create, configure, and enable services

@ Echo. service Startup ...... @ echo off @ SC create service name binPath = "C: \ Users \ Administrator \ Desktop \ win32srvdemo \ win32srvdemo \ Debug \ win32srvdemo.exe "@ net start service name @ SC config service name start = AUTO @ echo off @ echo. started! @ Pause

2. Close the service

@ Echo. Close the service @ echo off @ net stop service name @ echo off @ echo. Close the end! @ Pause

3. delete a service (close the service before deletion)

@ Echo. Service deletion @ echo off @ SC delete service name @ echo off @ echo. The deletion is complete! @ Pause

 

Ii. SC commands

Blog: http://blog.csdn.net/ddjj_1980/article/details/7493045

Reprinted: http://blog.csdn.net/moruna/article/details/9190733

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.