Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of orders for registering Services under window

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Description: SC is a command line program used to communicate with the service control manager.

Usage:

Sc [command] [service name]...

The format of the option is

You can type "sc [command]" for further help with the command

Command:

Query- queries the status of the service, or enumerates the status of the service type.

Queryex- queries the extended status of the service, or enumerates the status of the service type.

Start-start the service.

Pause- sends a PAUSE control request to the service.

Interrogate- sends an INTERROGATE control request to the service.

Continue- sends a CONTINUE control request to the service.

Stop-sends an STOP request to the service.

Config- changes the configuration of the service (permanently).

Description- changes the description of the service.

Failure- changes what happens when the service fails.

Qc- queries the configuration information of the service.

Description of the qdescription- query service.

Qfailure- query the operation performed by the failed service.

Delete-(from the registry) remove the service.

Create-create the service (add it to the registry).

Control- sends control to the service.

Sdshow- displays the security descriptor for the service.

Sdset- sets the security descriptor for the service.

GetDisplayName--- gets the DisplayName of the service.

GetKeyName- gets the ServiceKeyName of the service.

EnumDepend- enumerates the dependencies of services.

The following command does not query the service name:

Sc

Boot- (ok | bad) indicates whether to save the last startup as the last known good startup configuration

Lock- Lock Service Database

QueryLock- queries the LockStatus of SCManager database

Usage:

Start-> run-> cmd

Enter sc in the command line window that appears

Use sc/? Commands, querying other functions

Example 1: registration service (similar to something in linux where the system starts to load automatically)

Sc create ILMService binpath= "C:/Program Files/Subversion/bin/ILMService.exe-- service-r D:/svn" displayname= "ILMMainService" depend= Tcpip start= auto

Add service description: sc description "ILMService"identity management platform service program"

Where sc create is the sc registration service command

Svn: is the key name when the service is registered

Binpath: is the path and command parameter of the service loader startup file

Displayname: is the service display name

Depend: transport dependent protocol

Start: whether to start automatically

Explanation: the example above is to register a svn service

Example 2: start the service

Sc start MyService

Example 3: delete a service

Sc delete [servicename]

For example, to delete an apache2.2 service, do the following: sc delete apache2.2

Add: if the service cannot be deleted with the SC command, it can be deleted from the registry.

Start-> run reg delete HKLM/SYSTEM/CurrentControlSet/Services/ServiceName

Add:

The usage of the windows Registration Service Command sc

1. The difference between the service display name and the registration key. The display name is mainly displayed on the outside (such as Subversion Server). You can use the commands msconfig and service.msc to view it.

Key name, another method is to check it in HKEY_LOCAL_MACHINE- > system- > service in the regedit registry.

Conversion of key name and display name:

Sc GetKeyName (display name)-> get the key name from the display name

Sc GetDisplayName (key name)-> get the display name from the key name

two。 All operations on the service have to be done by the key name, and the display name does not work.

3. After getting the key name, you can operate the service like the linux command service.

Service startup sc start 'key name' for example: sc start svn

Service stop sc stop 'key name' for example: sc stop svn

Service deletes sc delete 'key name' for example: sc delete svn

For sc commands, windows is not commonly used, but service commands are often used under linux. In fact, both commands are the same, an example of registering under windows through svn.

Summary

The above is a summary of the order of registration service under window introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply you in time. Thank you very much for your support to the website!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report