Current location - Music Encyclopedia - Chinese History - Use the sc.exe command to view the service state management service under Windows.
Use the sc.exe command to view the service state management service under Windows.
Click start > run > enter "cmd" and enter sc in the pop-up DOS window to see the help of using sc command.

Syntax format of sc command:

sc? & lt server & gt? [command]? [service? Name]? & ltoption 1 & gt; ? & lt option & gt ...?

Example of using sc command:

View the running status of all services.

[sc Query Service Name] View the running status of the service.

[sc qc service name] View the configuration information of the service.

【sc? Start service name] Start service.

【sc? Stop service name] to stop the service.

【sc? Delete service name] Delete service.

[sc Configuration Service Name start= Auto | Demand | Disable]

Modify the service startup type. The values of startup parameters can be demand (manual), disabled (disabled) and automatic (automatic).

Note: there is a space after start=

Use skills

1: If the service name contains spaces, remember to put quotation marks on the service name. For example, sc stops My Services.

2. "Service Name" and "Service Display Name" are different. Sc instruction uses "service name".

We use the control panel => "administrative tools" = >; Open "Service", we can see the display name of the service, and double-click to open a service to see the real service name.

3.SC Start and sc stop are similar in function to net start and net stop, but they are faster and can stop more services.

4. The essence of the 4.scdelete command is to delete the ServiceName branch under HKEY _ local _ machine \ system \ current control set \ service. Therefore, you can also use the reg command to delete a file named ServiceName:

Reg delete HKLM\ System \ Current Control Set \ Service \ Service Name