Installing SonarCube 9 as Windows service not possible

I’m trying to install sonarcube 9 as a windows service on a windows server 2019.
At first i created an environment variable (SONAR_HOME) which directs to the root folder of sonar: C:\Services\sonarqube-
If I use “%SONAR_HOME%” in windows explorer, the sonar folder opens.
Now i try to install the service using this command in powershell ISE:
sc.exe create SonarQube binPath=""%SONAR_HOME%\bin\windows-x86-64\wrapper.exe" -s “%SONAR_HOME%\conf\wrapper.conf”"

It works and the service is created. But when i try to start the service, i always get an error:
“Service failed to start: The system cannot find the file specified”

But when i open the service properties and check the file paths to wrapper.exe and wrapper.conf both are correct and i can access both files using windows file explorer.

Also i’m able to start sonar using the .bat file “StartSonar.bat” - this works without any issue.

Anyone any idea for me? :slight_smile:

Did you create a system environment variable or a user environment variable ? If not yet the case, I suggest to try with a system one.

Hi, yes its an system environment variable

You should have a look on this post mentionning specificity for binPath parameter.
Space between binPath= and the value seems missing in your command.