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

**URL:** <https://community.stardog.com/t/stardog-bat-scripts-dont-work-with-spaces-in-the-path/634>\
**Category:** Bug\
**Created:** [October 9, 2017, 3:04pm UTC](https://community.stardog.com/t/stardog-bat-scripts-dont-work-with-spaces-in-the-path/634 "2017-10-09T15:04:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [October 9, 2017, 3:04pm UTC](https://community.stardog.com/t/stardog-bat-scripts-dont-work-with-spaces-in-the-path/634/1 "2017-10-09T15:04:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [October 10, 2017, 12:35pm UTC](https://community.stardog.com/t/stardog-bat-scripts-dont-work-with-spaces-in-the-path/634/2 "2017-10-10T12:35:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [October 11, 2017, 4:19pm UTC](https://community.stardog.com/t/stardog-bat-scripts-dont-work-with-spaces-in-the-path/634/3 "2017-10-11T16:19:20Z")

</div>

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](mailto:arwesterinen@gmail.com) or [andreaw@ninepts.com](mailto:andreaw@ninepts.com)  
[organizingknowledge.blogspot.com](http://organizingknowledge.blogspot.com)

---

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [October 11, 2017, 4:32pm UTC](https://community.stardog.com/t/stardog-bat-scripts-dont-work-with-spaces-in-the-path/634/4 "2017-10-11T16:32:31Z")

</div>

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](mailto:arwesterinen@gmail.com) or [andreaw@ninepts.com](mailto:andreaw@ninepts.com)  
[organizingknowledge.blogspot.com](http://organizingknowledge.blogspot.com)

---

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [October 11, 2017, 5:19pm UTC](https://community.stardog.com/t/stardog-bat-scripts-dont-work-with-spaces-in-the-path/634/5 "2017-10-11T17:19:51Z")

</div>

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](mailto:arwesterinen@gmail.com) or [andreaw@ninepts.com](mailto:andreaw@ninepts.com)  
[organizingknowledge.blogspot.com](http://organizingknowledge.blogspot.com)

---

<div class="post-metadata">

**Author:** ![stephen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/stephen/32/27_2.png) [@stephen](https://community.stardog.com/u/stephen)\
**Post date:** [October 12, 2017, 11:28am UTC](https://community.stardog.com/t/stardog-bat-scripts-dont-work-with-spaces-in-the-path/634/6 "2017-10-12T11:28:55Z")

</div>

Thanks, Andrea. This is good stuff!
