Stardog .bat scripts don't work with spaces in the path

I have been working with non-programmers to install Stardog and run a graphing program … But, these folks can’t even get Stardog started since they install it in places like “C:/Program Files/stardog 5”.

The .bat files need to put quotes around the path/file names.

Thanks.
Andrea

Hi Andrea, thanks for the catch. We’ll include this in the next Stardog release

Stephen, I solved the problem for my customers by:

  • Putting quotes around the text, %~dp0\helpers.bat, in both the
    stardog-admin and stardog.bat files
  • Modifying the following three lines in helpers.bat:
    • Line 66, putting quotes around the text, %STARDOG% (since the
      customers did not set STARDOG_HOME and it defaulted to the parent of the
      bat file)
    • Line 180, putting quotes around the text,
      %STARDOG%\server\dbms\log4j2.xml
    • Lines 185 and 189, remove the quotes from around the texts, %2 and
      %2* (since it is no longer needed due to the change in line 66)

In case anyone else needs this change.

Andrea Westerinen
T: 425.891.8407
arwesterinen@gmail.com or andreaw@ninepts.com
organizingknowledge.blogspot.com

Sorry, one more ... Here is the complete list:

  • Putting quotes around all occurrences of the text, %~dp0\helpers.bat,
    in both the stardog-admin and stardog.bat files
  • Putting quotes around the text, %STARDOG%, in the string,
    -Dstardog.install.location=%STARDOG%, in both the stardog-admin and
    stardog.bat files
  • Modifying the following three lines in helpers.bat:
    • Line 66, putting quotes around the text, %STARDOG% (since the
      customers did not set STARDOG_HOME and it defaulted to the parent of the
      bat file)
    • Line 180, putting quotes around the text,
      %STARDOG%\server\dbms\log4j2.xml
    • Lines 185 and 189, remove the quotes from around the texts, %2 and
      %2* (since it is no longer needed due to the change in line 66)

Andrea Westerinen
T: 425.891.8407
arwesterinen@gmail.com or andreaw@ninepts.com
organizingknowledge.blogspot.com

Lastly, I would suggest changing line 8 in the stardog.bat file to use the
'IF NOT DEFINED ...' test (as in stardog-admin.bat), versus 'IF ...=""'.
That line in stardog.bat also caused me problems.

Andrea Westerinen
T: 425.891.8407
arwesterinen@gmail.com or andreaw@ninepts.com
organizingknowledge.blogspot.com

Thanks, Andrea. This is good stuff!