<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 12/14/2012 11:16 PM, Wes James
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAFjCMHu9Ze-POsN_DoSCPb4RTgL-K21Vpbz4q=CQ3AaFtgtRJQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      Looking at this documentation to see where .erlang.cookie might be
      saved for a service (installed with erlsrv) so I don't have to do
      -cookie on the command line, the docs at:<br>
      <br>
      <a moz-do-not-send="true"
        href="http://www.erlang.org/doc/man/erlsrv.html">http://www.erlang.org/doc/man/erlsrv.html</a><br>
      <br>
      say that the default working directory is:<br>
      <br>
      %SystemDrive%%SystemPath%<br>
      <br>
      There is a %SystemDrive% in win 7 (type set in the cmd.exe window)
      but there is no %SystemPath%.  There is a %windir% and
      %SystemRoot% which are c:\windows on my system.  Anyway, I don't
      see .erlang.cookie in c:\windows after using erlsrv and starting
      the service. Where is .erlang.cookie for erlsrv services?<br>
    </blockquote>
    Yes, the %SystemPath% is not present on modern Windows. The local
    administrator (which is the user that runs the service) has
    c:\Windows as home directory by default, but the service runs with
    c:\Windows\system32 as default directory.<br>
    <br>
    One way to make sure is to simply start a service with a debug
    console and add -emu_args as a parameter, click "Show message" or
    whatever your locale has to select in the dialogue that pops up (or
    does not pop up but starts to blink in the task bar) when you start
    such a service and then do a pwd(). In the Erlang shell that you
    will see the -home parameter.<br>
    <br>
    Example (replace mentally any paths with the appropriate ones for
    your system):<br>
    <br>
    C:\blabla> cd "c:\Program Files\erl5.9.3.1\erts-5.9.3.1\bin"<br>
    C:\Program Files\erl5.9.3.1\erts-5.9.3.1\bin>erlsrv add
    testservice -debug console -arg -emu_args<br>
    C:\Program Files\erl5.9.3.1\erts-5.9.3.1\bin>erlsrv start
    testservice<br>
    <br>
    ...click on the "show me the message" button in the service control
    manager dialogue, which will take you to a blank screen with only
    the Erlang shell of the service and a dialogue that can take you
    back to the desktop. In that shell, you will see the full command
    line to the VM including the '-home' parameter:<br>
    ---------------<br>
    Executing: C:\blablabla...\beam.smp.dll C:\blablabla...\beam.smp.dll
    -- -root C:\blablabla -progname erl -- -home c:\Windows etc etc etc<br>
    1> pwd().<br>
    c:/Windows/system32<br>
    2><br>
    ---------------<br>
    ...click on the get me back button in the dialogue that hangs beside
    the shell. The directory after the -home in the "slogan" at the top
    of the shell should be the home directory. The result from pwd() is
    the default "current directory" of the service.<br>
    <br>
    So the .erlang.cookie should reside in what -home says, which
    corresponds to %SystemDrive%%SystemRoot%, while files created in
    current directory will go into whatever pwd() shows. <br>
    <br>
    Now stop and remove the service:<br>
    C:\Program Files\erl5.9.3.1\erts-5.9.3.1\bin>erlsrv stop
    testservice<br>
    ...will take some time because of the peculiarities of a debug
    console....<br>
    C:\Program Files\erl5.9.3.1\erts-5.9.3.1\bin>erlsrv remove
    service<br>
    <br>
    Hope that helps!<br>
    <br>
    Cheers,<br>
    /Patrik<br>
    <br>
    <blockquote
cite="mid:CAFjCMHu9Ze-POsN_DoSCPb4RTgL-K21Vpbz4q=CQ3AaFtgtRJQ@mail.gmail.com"
      type="cite">
      <br>
      Thanks,<br>
      <br>
      wes<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>