Not much nonsense. It's more straightforward to look at the command line!
1. directly use cmd to perform service operations
1. Install the service
SC create test3 binpath = "C: \ Users \ Administrator \ Desktop \ win32srvdemo \ win32srvdemo \ debug \ win32srvdemo.exe"
Test3 indicates the created Service name. The binpath is followed by the path where the EXE file is run.
2. Configure the service
There are the following centralized methods:
SC config service name start = auto (Automatic)
SC config service name start = demand(Manual)
SC config service name start = disabled (disabled)
For example, the following command is automatically started when the host is enabled in the XP system:
SC config test3 start = auto
3. enable the Service
Net start test3
4. Close the service
Net stop test3
5. delete a service
SC Delete test3
2. For ease of use, you can edit it as a bat batch file.
(Create a new TXT file, name it yourself, and change the suffix to the. BAT file)
1. Create, configure, and enable services
@ Echo. service Startup ...... @ echo off @ SC create test3 binpath = "C: \ Users \ Administrator \ Desktop \ win32srvdemo \ win32srvdemo \ debug \ win32srvdemo.exe "@ Net start test3 @ SC config test3 start = auto @ echo off @ echo. started! @ Pause
2. Close the service
@ Echo. Close the service @ echo off @ net stop test3 @ echo off @ echo. Close the end! @ Pause
3. delete a service
@ Echo. Delete the service @ echo off @ SC Delete test3 @ echo off @ echo. The deletion is complete! @ Pause
Iii. SC
Can refer to a netizen's blog --- SC command management service status: http://blog.csdn.net/ddjj_1980/article/details/7493045