There seems to be another problem with this line:
echo y|cacls %CONFIG_DIR%\management\jmxremote.* /P %USERNAME%:F > nul
If you replace 'y' by the localized first character of 'yes' then the cacls command runs without problems. But you could still get the same error message. Because:
1. My user name is sebastian. My notebook has the name NB7 in a domain named BUERO.
2. If I install dm server then the jmxremote.* files always have BUERO/sebastian as the 'current owner of this item'.
3. If I remove all permission entries on the jmxremote.* files and run startup.bat then the above line in the startup file gives NB7/sebastian full access to the jmxremote files. Since NB7/sebastian and BUERO/sebastian is not same this results in the same error message.
If I manually grant full access to the 'current owner ' of the jmxremote.* files BUERO/sebastian and remove the line 'echo y|cacls ...' from the startup script, it works.