@echo off

rem Determine the port on which the service will run on
for /F "eol=# delims== tokens=1,*" %%a in (oXygenHTTPLicenseServer.vmoptions) do (
  IF "%%a" == "-Dcom.oxygenxml.licenseserver.port" set port=%%b
)
if "%port%"=="" (set port="8080")

echo Starting oXygenHTTPLicenseServer service ...
echo Go to http://localhost:%port%/ to manage oXygen HTTP License Server

IF "%1"=="" (
oXygenHTTPLicenseServer.exe /start
) ELSE (
oXygenHTTPLicenseServer.exe /start %*
)

pause