I have a script that I right-click on and select run as administrator, so yes, it has to be done as admin.
@echo off
@rem
@rem sample erlang install service script
@rem - add then start ecom erlang service
@rem - if it already exists, stop then remove first before adding and starting
@rem
@set erl_service=0ecom
@erlsrv list %erl_service% | @findstr /i "%erl_service%"
@if errorlevel 1 goto next
@echo.
@rem echo Removing erl service...
@erlsrv remove "%erl_service%"
rem @goto:EOF
:next
@SETLOCAL ENABLEDELAYEDEXPANSION
@SET comp=computer-name
@set module=-s ecom
@set onfail=-onfail restart
@rem echo %node%
@set root=-w "C:/windows/erl"
@set srvc_name=-i 0ecom
@set boot=-boot c:/windows/erl/start_ssl_ecom -proto_dist inet_tls -ssl_dist_opt server_certfile c:/windows/erl/ssl/cert.pem -ssl_dist_opt server_keyfile c:/windows/erl/ssl/key.pem -ssl_dist_opt server_secure_renegotiate true client_secure_renegotiate true
@rem set args=-args "%boot% %module%"
@set args=-args "%boot% %module%"
@echo.
@rem echo Adding erl service...
@erlsrv add "%erl_service%" %node% %root% %onfail% %args%
@echo.
@rem echo Starting erl service...
@erlsrv start %erl_service%
@echo.
:end
@pause
@goto:EOF
-------------
Then I paste this in to an elevated cmd shell (for some reason it won't run from a file) to set the service to automatic delayed:
@FOR /F "delims=" %i IN ('sc getkeyname 0ecom') DO set z=%i
@echo %z%
@for /f "tokens=3" %i IN ("%z%") DO set erl_servicedispname=%i
@echo %erl_servicedispname%
@sc config %erl_servicedispname% start= delayed-auto
-------
I use it to install ecom.beam as a service from this project:
-wes