SC .exe command functions

Source: Internet
Author: User
SC .exe commandFunction list:

1. Change the service startup status (this is a useful feature)

2. delete a service (unless it is clear about the services required by software and hardware on your computer, it is not recommended to delete any system services, especially basic services)

3. stop or start the service (the function is similar to net stop/start, but more services are faster and can be stopped)

The command format is as follows:

Modify the command line format of the Service Startup type to (note that start = is followed by a space)

SC config service name start = demand (set service to manual start)

SC config service name start = disabled (set service to disabled)

The command line format for stopping/starting a service is

SC stop/start service name

Note: The display name of the service is commonly used, and the above refers to the service name. You can double-click the corresponding service in the control panel> Management Tools> service to query it.

The following is an example of the specific setting method:

For example, if the remote registry service is set to manual

SC config RemoteRegistry start = demand

The disabled format is:

SC config RemoteRegistry start = disabled

When the service is stopped, the format is:

SC stop RemoteRegistry

First, check the service name you want to set and make a batch file according to the above format. After reinstalling the system, you only need to run the batch file.

The following are my settings, which are modeled on XpSp2 and can be used to add, delete, and modify the system. Note: No auto update, security center, or firewall has been added to XP SP2.

SC config Alerter start = demand

SC config TrkWks start = demand

SC config helpsvc start = demand

SC config policyAgent start = demand

SC config dmserver start = demand

SC config WmdmpmSn start = demand

SC config Spooler start = demand

SC config RemoteRegistry start = demand

SC config NtmsSvc start = demand

SC config seclogon start = demand

SC config Schedule start = demand

SC config WebClient start = demand

SC config W32Time start = demand

SC config WZCSVC start = demand

SC config ERSvc start = demand

SC config Themes start = demand

SC config FastUserSwitchingCompatibility start = disabled

SC config Messenger start = disabled

SC config protectedStorage start = disabled

SC config SSDpSRV start = disabled

SC config TermService start = disabled

SC config ShellHWDetection start = disabled

If you need to immediately close the service, you can also add the following code after the above Code

SC stop W32Time

SC stop ShellHWDetection

SC stop TrkWks

SC stop helpsvc

SC stop dmserver

SC stop yyagent

SC stop Spooler

SC stop RemoteRegistry

SC stop seclogon

SC stop Schedule

SC stop WZCSVC

SC stop ERSvc

SC stop Themes

SC stop FastUserSwitchingCompatibility

SC stop protectedstorage

SC stop ssdpsrv

SC stop WebClient

Finally, save the modified Code as services. cmd. When you configure the service in the future, run the pre-saved batch file directly to get twice the result with half the effort.

Put the batch file together with the saved batch file, and then execute the batch file.

If you are familiar with the Registry, you may want to use the registry to set the Startup Type of the service. This is also a feasible method, but it has internal limitations. The reason is that the key values of the Service Startup Type in the Registry are long and scattered, which is inconvenient to organize and easy to error. Therefore, this method is suitable for unattended installation.

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.