In Windows, SC CREATE command line is used to add, create, and modify services.
SC create bits binpath = "C: \ windows \ system32 \ svchost.exe-K netsvcs" type = share start = auto displayname = "Background Intelligent Transfer Service" depend = RPCSS/EventSystem
Description:
SC description bits "transmits files in the background using idle network bandwidth. If the service is disabled, such as Windows Update and MSN Explorer, programs and other information cannot be automatically downloaded. If this service is disabled, any service dependent on it may not be able to transmit files directly through ie without fault tolerance. Once bits is disabled, files may not be transmitted. "
Add service:
SC create PolicyAgent binpath = "C: \ windows \ system32 \ lsass.exe" type = share start = auto displayname = "IPSec Services" depend = RPCSS/TCPIP/IPSec
Description:
SC description yyagent "provides client-to-server security on TCP/IP networks. If the service is disabled, the TCP/IP security between the client and the server on the network is unstable. If this service is disabled, any service dependent on it cannot be started. "
For more information about SC commands, see help SC
(Back up the registry before modification ),
Svchost shared service special: you may need to go to the Registry location after restart: [HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ svchost], View "C: \ windows \ system32 \ svchost.exe-K netsvcs "is a key named in red (here, netsvcs is used as an example ), whether the service with SC create bits blue characters is defined in the key value (Here we use bits as an example). If not, add the service name (Here we use bits as an example) in the key value, restart again.
To set the program to a Windows service, you can use the SC command that comes with windows to create the service.
The basic usage of this command is as follows:
Open the CMD command and enter the following information:
1. Create a service:
SC create secserver binpath = "E: \ your master \ mainconsole \ securitymagcenter2.exe-service" displayname = "secserver2" depend = TCPIP start = auto
(Note that there is a space)
SC create iimsaservice0 binpath = "\" C: \ Program Files \ iimsaservice \ intnal.exe \ "-service" displayname = "iimsaservice0" depend = TCPIP start = auto
The above red font must be replaced with the information of the created service. Do not place the program path in the Chinese directory.
After executing the command in cmd, if no error is reported, a secserver service is normally displayed in the Service Manager (services. MSC.
2. delete a service:
SC Delete secserver
3. For other commands, enter SC /? To view.