[erlang-questions] erlsrv on windows 10 problem

Dan Gudmundsson <>
Tue May 3 09:17:02 CEST 2016


Thanks, I figured it should work, but I have disabled the testing since it
requires manual starting of elevated cmd shell.

On Mon, May 2, 2016 at 9:51 PM Wes James <> wrote:

> I have a script that I right-click on and select run as administrator, so
> yes, it has to be done as admin.
>
> This is what I use for win 10 (setup-erlsrv.cmd):
>
> @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
> @set node=-name ecom@%comp%.nr.usu.edu
> @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:
>
> https://github.com/comptekki/esysman
>
> -wes
>
> On Mon, May 2, 2016 at 1:18 PM, Dan Gudmundsson <> wrote:
>
>> I do not remember the exact error message now, but what I gathered you
>> had to start erlsrv (and erlang) from an "elevated" shell, otherwise you
>> don't have the permissions to install the services. And we run our automtic
>> tests from a "admin" user but not from an "elevated" shell.
>>
>> But I don't really know what I'm talking about here, as I said, our
>> windows competence is really low.
>>
>> So how you install the services, do you run start erlang from inside
>> and admin cmd prompt.
>>
>> Regards
>> /Dan
>>
>> On Mon, May 2, 2016 at 7:27 PM Wes James <> wrote:
>>
>>> This is with the 18.3 windows binary from erlang.org.
>>>
>>> -wes
>>> On Fri, Apr 29, 2016 at 11:59 PM, Dan Gudmundsson <>
>>> wrote:
>>>
>>>> Well you got it run at all, that is something, I have disabled our
>>>> testing of
>>>> services on Windows 10 for now, master branch, since I could not get it
>>>> run at all.
>>>>
>>>> From what I googled and understood you will need start the services
>>>> from an elevated shell, an administer user is not enough.
>>>> But you might already do that or I got it wrong.
>>>>
>>>> Anyway, our Windows knowledge, and priority, is not at the highest
>>>> level.
>>>> So any help would be appreciated.
>>>>
>>>> /Dan
>>>>
>>>> On Fri, Apr 29, 2016 at 5:55 PM Wes James <> wrote:
>>>>
>>>>> I use erlsrv to install an erlang application on windows.  Windows 7
>>>>> works fine, but on windows 10, I have to go in and change the service from
>>>>> automatic to Automatic (delayed start), otherwise the app never runs on
>>>>> system start up.  Any idea how to fix this?
>>>>>
>>>>> I just found this windows command:
>>>>>
>>>>> sc config SVCNAME start= delayed-auto
>>>>>
>>>>> I can use that in the install script.
>>>>>
>>>>> I'd still like it to start with just automatic.  With the delayed
>>>>> option, it takes several extra minutes for the service to start running.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> -wes
>>>>> _______________________________________________
>>>>> erlang-questions mailing list
>>>>> 
>>>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>>>
>>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20160503/0b244cd1/attachment.html>


More information about the erlang-questions mailing list