Add a new Windows Service

• Download Windows Resource Kit Tools from Official Microsoft Download Center

https://www.microsoft.com/en-us/download/details.aspx?id=17657

• Run the registry script

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\moiersvc]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\moiersvc\Parameters]
"Application"="c:\\ProAgentAddon\\bin\\StatusQuery.exe"

• Run the bat script

c:\ProAgentAddon\bin\instsrv.exe moiersvc c:\ProAgentAddon\bin\srvany.exe
sc config moiersvc DisplayName= "ProFlex3 Function Query"
sc description moiersvc "Query ProFlex3 function status at regular basis and write messages when function status is changed."

• Run the command "net start moiersvc"

猜你喜欢

转载自www.cnblogs.com/moiez/p/9115874.html