diff --git a/datastore_server/dist/share-manager.sh b/datastore_server/dist/share-manager.sh
index 56cbc5cf404c9a13c7464fd606a062fd1002a628..de1e871e0277f74b72cfdde83846e844335daef2 100644
--- a/datastore_server/dist/share-manager.sh
+++ b/datastore_server/dist/share-manager.sh
@@ -6,15 +6,16 @@ BASE=`dirname "$0"`
 if [ ${BASE#/} == ${BASE} ]; then
     BASE="`pwd`/${BASE}"
 fi
+cd "$BASE"
 CONFFILE=etc/datastore_server.conf
 LIB_FOLDER=lib
 
 test -f $CONFFILE && source $CONFFILE
 if [ "$JAVA_HOME" != "" ]; then
-	JAVA_BIN="$JAVA_HOME/bin/java"
+    JAVA_BIN="$JAVA_HOME/bin/java"
 else
-	JAVA_BIN="java"
+    JAVA_BIN="java"
 fi
 
 CP=`echo $LIB_FOLDER/datastore_server.jar $LIB_FOLDER/*.jar | sed 's/ /:/g'`
-"$JAVA_BIN" $JAVA_OPTS -classpath $CP ch.systemsx.cisd.openbis.dss.client.admin.ShareManagerApplication
+"$JAVA_BIN" $JAVA_OPTS -classpath $CP ch.systemsx.cisd.openbis.dss.client.admin.ShareManagerApplication "$@"
\ No newline at end of file