CodePudding user response:
To program an entire directory replication, such as call Mail2, then register the service program (with the new keyword, use OpenSCManager, CreateService, CloseServiceHandle API functions), configure port (port conflict),CodePudding user response:
1, for their own services, the establishment of a few directories, such as: d: \ Server1 \ d: \ Server2 \ d: \ Server3 \... 2, will perform a file, copy into different categories, d: \ Server1 \ MySer exed: \ Server2 \ MySer exed: \ Server3 \ MySer exe... 3, use instsrv. Exe, instruction format: instsrv [service] [application path] note: instsrv Myser1 d: \ Server1 \ MySer exeinstsrv Myser1 d: \ Server2 \ MySer exeinstsrv Myser1 d: \ Server3 \ MySer exe... 4,在注册表项"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services"中自动增加项[服务名],并在其下成功添加各个键值:"DisplayName"=服务显示名 (字符串值)"Description"=服务描述 (字符串值)"ImagePath"=应用程序路径 (可扩充字符串值)"ObjectName"="LocalSystem" (字符串值)"Type"=10(16进制) (dword值)"Start"=2(16进制) (dword值)"ErrorControl"=1(16进制) (dword值)如果不使用instsrv.exe,同样可以在注册表中手工添加实现:在"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services"下新建一个项,项名为要显示的服务名,并在其下新建以上各个键,填入键值,注意:使用不同的'服务名称字符'(关键词),这样在"任务管理器"的"服务",显示出服务项目,你能区别那个服务项目, 注意参数要不相同,特别是配置端口要不相同,否则二个服务执行同一任务,出错冲突,CodePudding user response:
1, for their own services, the establishment of a few directories, such as:D: \ Server1 \
D: \ Server2 \
D: \ Server3 \
.
2, will perform a file, copy into different categories,
D: \ Server1 \ MySer exe
D: \ Server2 \ MySer exe
D: \ Server3 \ MySer exe
.
3, use instsrv. Exe, instruction format: instsrv [service] [application path]
Instsrv Myser1 d: \ Server1 \ MySer exe
Instsrv Myser1 d: \ Server2 \ MySer exe
Instsrv Myser1 d: \ Server3 \ MySer exe
.
4, in the registry entries "HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services " to automatically increase in [service], and under which each key value adding success:
"DisplayName"=the service display name (a string value)
"Description=" service Description (string value)
"ImagePath"=application path (extensible string value)
"ObjectName"="LocalSystem" (string value)
"Type"=10 (hexadecimal) (dword value)
"Start"=2 (hexadecimal) (dword value)
"ErrorControl"=1 (hexadecimal) (dword value)
If you don't use instsrv. Exe, can also be in the registry manually add implementation: in "HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services " to create a new item, called to display the service name, and in the newly built above each key underneath, and fill in the key value,
Note:
1, use different 'service name characters' (keywords), so in the "task manager" of the "service", shows a service project, can you tell the difference between the service project,
Or the same number 2, and, in particular configuration port or the same, otherwise the two services to perform the same tasks, conflict error,
CodePudding user response:
2, or the same parameters, especially the configuration port or the same, otherwise the two services to perform the same tasks, conflict error,