In Windows, most of the services are registered in the system with "one-click installation". For example, by default, we can use memcached-D install (PS: for more options about memcached, refer to memcached-H.) run the memcached command to register the memcached service as a system service. When you need to install multiple memcached services on the same machine for testing, the problem occurs. Repeated execution of memcached-D install will get the following error: failed to install service or service already installed! Is it a headache? In fact, Bill has provided a useful command for this purpose: SC, which is specially used to manage Windows system services. The command format for SC to create a system service is as follows: SC create [service name] [binpath =] <option1> <option2>... Create options: Note: The option name provided des the equal sign. Type = <own | share | interact | kernel | filesys | rec> (Default = own) Start = <boot | system | auto | demand | disabled> (Default = demand) Error = <normal | severe | critical | ignore> (Default = normal) Binpath = <binarypathname> Group = <loadordergroup> Tag = <Yes | NO> Depend = <dependencies (separated by/(forward slash)> OBJ = <accountname | objectname> (Default = LocalSystem) Displayname = <display name> Password = <password> With it, we can easily add multiple identical services. Of course, their names must be different! For example, to add a new memcached service named memcached slave, run the following command: D: \> SC create "memcached slave" Start = auto binpath = "path \ To \ your \ memcached.exe-D install-M 32-P 22122" displayname = "memcached slave" If you manually enter this command, the help information of the SC CREATE command may be displayed every time you execute the command. That is to say, the command format is incorrect ?! After review, You may thank Bill again... In fact, the problem is very simple. As shown in the help information of the SC CREATE Command, any optional equal sign must be followed by a space and then the value of the option! Yes. Why don't you take a closer look ?! From: http://hi.baidu.com/mcspring/blog/item/976407f7d0ddb02c720eec81.html |