From c2219eade1904400e21f8b39e3fd9527229580a4 Mon Sep 17 00:00:00 2001
From: pvarga <pvarga@opentext.com>
Date: Mon, 11 Jul 2016 22:36:23 +0000
Subject: [PATCH] OPENDJ-1976 setup.bat doesn't work without 8.3 format

---
 opendj-server-legacy/resource/bin/ldifsearch.bat         |    2 
 opendj-server-legacy/resource/bin/manage-tasks.bat       |    2 
 opendj-server-legacy/resource/bin/stop-ds.bat            |   12 +++---
 opendj-server-legacy/resource/bin/control-panel.bat      |    4 +-
 opendj-server-legacy/resource/bin/manage-account.bat     |    2 
 opendj-server-legacy/resource/bin/restore.bat            |    2 
 opendj-server-legacy/resource/bin/start-ds.bat           |    6 +-
 opendj-server-legacy/resource/bin/ldapdelete.bat         |    2 
 opendj-server-legacy/resource/bin/make-ldif.bat          |    6 +-
 opendj-server-legacy/resource/bin/_client-script.bat     |    4 +-
 opendj-server-legacy/resource/bin/ldapsearch.bat         |    2 
 opendj-server-legacy/resource/bin/ldapcompare.bat        |    2 
 opendj-server-legacy/resource/bin/backendstat.bat        |    2 
 opendj-server-legacy/resource/bin/verify-index.bat       |    2 
 opendj-server-legacy/resource/bin/dsconfig.bat           |    2 
 opendj-server-legacy/resource/bin/dsreplication.bat      |    2 
 opendj-server-legacy/resource/bin/import-ldif.bat        |    2 
 opendj-server-legacy/resource/bin/windows-service.bat    |    2 
 opendj-server-legacy/resource/bin/_server-script.bat     |    4 +-
 opendj-server-legacy/resource/bin/export-ldif.bat        |    2 
 opendj-server-legacy/resource/bin/status.bat             |    2 
 opendj-server-legacy/resource/bin/_mixed-script.bat      |    4 +-
 opendj-server-legacy/resource/bin/rebuild-index.bat      |    2 
 opendj-server-legacy/resource/bin/encode-password.bat    |    2 
 opendj-server-legacy/resource/bin/list-backends.bat      |    2 
 opendj-server-legacy/resource/bin/base64.bat             |    2 
 opendj-server-legacy/resource/bin/backup.bat             |    2 
 opendj-server-legacy/resource/bin/ldif-diff.bat          |    2 
 opendj-server-legacy/resource/bin/ldapmodify.bat         |    2 
 opendj-server-legacy/resource/bin/ldifmodify.bat         |    2 
 opendj-server-legacy/resource/bin/_script-util.bat       |   12 +++---
 opendj-server-legacy/resource/bin/ldappasswordmodify.bat |    2 
 opendj-server-legacy/resource/bin/dsjavaproperties.bat   |    2 
 33 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/opendj-server-legacy/resource/bin/_client-script.bat b/opendj-server-legacy/resource/bin/_client-script.bat
index 9108865..76e0797 100644
--- a/opendj-server-legacy/resource/bin/_client-script.bat
+++ b/opendj-server-legacy/resource/bin/_client-script.bat
@@ -19,12 +19,12 @@
 rem be invoked directly by end users.
 
 setlocal
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
+set DIR_HOME=%~dp0..
 set INSTALL_ROOT=%DIR_HOME%
 
 set INSTANCE_DIR=
 if exist "%INSTALL_ROOT%\instance.loc" (
-  set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
+  set /p INSTANCE_DIR=<"%INSTALL_ROOT%\instance.loc"
 ) else (
 set INSTANCE_DIR=.
 )
diff --git a/opendj-server-legacy/resource/bin/_mixed-script.bat b/opendj-server-legacy/resource/bin/_mixed-script.bat
index eafd7c2..443c53b 100644
--- a/opendj-server-legacy/resource/bin/_mixed-script.bat
+++ b/opendj-server-legacy/resource/bin/_mixed-script.bat
@@ -19,12 +19,12 @@
 rem be invoked directly by end users.
 
 setlocal
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
+set DIR_HOME=%~dp0..
 set INSTALL_ROOT=%DIR_HOME%
 
 set INSTANCE_DIR=
 if exist "%INSTALL_ROOT%\instance.loc" (
-  set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
+  set /p INSTANCE_DIR=<"%INSTALL_ROOT%\instance.loc"
 ) else (
 set INSTANCE_DIR=.
 )
diff --git a/opendj-server-legacy/resource/bin/_script-util.bat b/opendj-server-legacy/resource/bin/_script-util.bat
index 9e62280..4e83697 100644
--- a/opendj-server-legacy/resource/bin/_script-util.bat
+++ b/opendj-server-legacy/resource/bin/_script-util.bat
@@ -32,11 +32,11 @@
 
 :setInstanceRoot
 setlocal
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
+set DIR_HOME=%~dp0..
 set INSTALL_ROOT=%DIR_HOME%
 set INSTANCE_DIR=
 if exist "%INSTALL_ROOT%\instance.loc" (
-  set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
+  set /p INSTANCE_DIR=<"%INSTALL_ROOT%\instance.loc"
 ) else (
 set INSTANCE_DIR=.
 )
@@ -52,8 +52,8 @@
 if "%SET_CLASSPATH_DONE%" == "true" goto end
 rem get the absolute paths before building the classpath
 rem it also helps comparing the two paths
-FOR /F %%i IN ("%INSTALL_ROOT%")  DO set INSTALL_ROOT=%%~dpnxi
-FOR /F %%i IN ("%INSTANCE_ROOT%") DO set INSTANCE_ROOT=%%~dpnxi
+FOR /F "delims=" %%i IN ("%INSTALL_ROOT%")  DO set INSTALL_ROOT=%%~dpnxi
+FOR /F "delims=" %%i IN ("%INSTANCE_ROOT%") DO set INSTANCE_ROOT=%%~dpnxi
 call "%INSTALL_ROOT%\lib\setcp.bat" %INSTALL_ROOT%\lib\bootstrap-client.jar
 set CLASSPATH=%INSTANCE_ROOT%\classes;%CLASSPATH%
 if "%INSTALL_ROOT%" == "%INSTANCE_ROOT%" goto setClassPathDone
@@ -67,8 +67,8 @@
 if "%SET_CLASSPATH_DONE%" == "true" goto end
 rem get the absolute paths before building the classpath
 rem it also helps comparing the two paths
-FOR /F %%i IN ("%INSTALL_ROOT%")  DO set INSTALL_ROOT=%%~dpnxi
-FOR /F %%i IN ("%INSTANCE_ROOT%") DO set INSTANCE_ROOT=%%~dpnxi
+FOR /F "delims=" %%i IN ("%INSTALL_ROOT%")  DO set INSTALL_ROOT=%%~dpnxi
+FOR /F "delims=" %%i IN ("%INSTANCE_ROOT%") DO set INSTANCE_ROOT=%%~dpnxi
 call "%INSTALL_ROOT%\lib\setcp.bat" %INSTALL_ROOT%\lib\bootstrap.jar
 set CLASSPATH=%INSTANCE_ROOT%\classes;%CLASSPATH%
 if "%INSTALL_ROOT%" == "%INSTANCE_ROOT%" goto setClassPathWithOpenDJLoggerDone
diff --git a/opendj-server-legacy/resource/bin/_server-script.bat b/opendj-server-legacy/resource/bin/_server-script.bat
index d9e88f0..257acc4 100644
--- a/opendj-server-legacy/resource/bin/_server-script.bat
+++ b/opendj-server-legacy/resource/bin/_server-script.bat
@@ -19,12 +19,12 @@
 rem be invoked directly by end users.
 
 setlocal
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
+set DIR_HOME=%~dp0..
 set INSTALL_ROOT=%DIR_HOME%
 
 set INSTANCE_DIR=
 if exist "%INSTALL_ROOT%\instance.loc" (
-  set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
+  set /p INSTANCE_DIR=<"%INSTALL_ROOT%\instance.loc"
 ) else (
 set INSTANCE_DIR=.
 )
diff --git a/opendj-server-legacy/resource/bin/backendstat.bat b/opendj-server-legacy/resource/bin/backendstat.bat
index 824b00e..4a3ce01 100644
--- a/opendj-server-legacy/resource/bin/backendstat.bat
+++ b/opendj-server-legacy/resource/bin/backendstat.bat
@@ -18,5 +18,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.backends.pluggable.BackendStat"
 set SCRIPT_NAME=backendstat
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/backup.bat b/opendj-server-legacy/resource/bin/backup.bat
index ee5afad..d1d9e2e 100644
--- a/opendj-server-legacy/resource/bin/backup.bat
+++ b/opendj-server-legacy/resource/bin/backup.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.BackUpDB"
 set SCRIPT_NAME=backup
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_mixed-script.bat" %*
+call "%~dp0\..\lib\_mixed-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/base64.bat b/opendj-server-legacy/resource/bin/base64.bat
index 635c63f..b79973e 100644
--- a/opendj-server-legacy/resource/bin/base64.bat
+++ b/opendj-server-legacy/resource/bin/base64.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.util.Base64"
 set SCRIPT_NAME=base64
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/control-panel.bat b/opendj-server-legacy/resource/bin/control-panel.bat
index 7ea417d..493b340 100644
--- a/opendj-server-legacy/resource/bin/control-panel.bat
+++ b/opendj-server-legacy/resource/bin/control-panel.bat
@@ -16,12 +16,12 @@
 rem Portions Copyright 2011-2012 ForgeRock AS.
 
 setlocal
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
+set DIR_HOME=%~dp0..
 set INSTALL_ROOT=%DIR_HOME%
 
 set INSTANCE_DIR=
 if exist "%INSTALL_ROOT%\instance.loc" (
-  set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
+  set /p INSTANCE_DIR=<"%INSTALL_ROOT%\instance.loc"
 ) else (
 set INSTANCE_DIR=.
 )
diff --git a/opendj-server-legacy/resource/bin/dsconfig.bat b/opendj-server-legacy/resource/bin/dsconfig.bat
index efc33ff..358d7c5 100644
--- a/opendj-server-legacy/resource/bin/dsconfig.bat
+++ b/opendj-server-legacy/resource/bin/dsconfig.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.forgerock.opendj.config.dsconfig.DSConfig"
 set SCRIPT_NAME=dsconfig
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/dsjavaproperties.bat b/opendj-server-legacy/resource/bin/dsjavaproperties.bat
index 3234f05..336c8d6 100644
--- a/opendj-server-legacy/resource/bin/dsjavaproperties.bat
+++ b/opendj-server-legacy/resource/bin/dsjavaproperties.bat
@@ -19,4 +19,4 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.JavaPropertiesTool"
 set SCRIPT_NAME=dsjavaproperties
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
diff --git a/opendj-server-legacy/resource/bin/dsreplication.bat b/opendj-server-legacy/resource/bin/dsreplication.bat
index 28c7e59..a0bbae3 100644
--- a/opendj-server-legacy/resource/bin/dsreplication.bat
+++ b/opendj-server-legacy/resource/bin/dsreplication.bat
@@ -32,4 +32,4 @@
 goto callScript
 
 :callScript
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
diff --git a/opendj-server-legacy/resource/bin/encode-password.bat b/opendj-server-legacy/resource/bin/encode-password.bat
index c8e5325..943e121 100644
--- a/opendj-server-legacy/resource/bin/encode-password.bat
+++ b/opendj-server-legacy/resource/bin/encode-password.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.EncodePassword"
 set SCRIPT_NAME=encode-password
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/export-ldif.bat b/opendj-server-legacy/resource/bin/export-ldif.bat
index 3a59b97..8abdd02 100644
--- a/opendj-server-legacy/resource/bin/export-ldif.bat
+++ b/opendj-server-legacy/resource/bin/export-ldif.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.ExportLDIF"
 set SCRIPT_NAME=export-ldif
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_mixed-script.bat" %*
+call "%~dp0\..\lib\_mixed-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/import-ldif.bat b/opendj-server-legacy/resource/bin/import-ldif.bat
index 48fe20a..dfb8a11 100644
--- a/opendj-server-legacy/resource/bin/import-ldif.bat
+++ b/opendj-server-legacy/resource/bin/import-ldif.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.ImportLDIF"
 set SCRIPT_NAME=import-ldif
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_mixed-script.bat" %*
+call "%~dp0\..\lib\_mixed-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/ldapcompare.bat b/opendj-server-legacy/resource/bin/ldapcompare.bat
index 2a0c1ae..b7f0377 100644
--- a/opendj-server-legacy/resource/bin/ldapcompare.bat
+++ b/opendj-server-legacy/resource/bin/ldapcompare.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.LDAPCompare"
 set SCRIPT_NAME=ldapcompare
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/ldapdelete.bat b/opendj-server-legacy/resource/bin/ldapdelete.bat
index a08b2fc..271086e 100644
--- a/opendj-server-legacy/resource/bin/ldapdelete.bat
+++ b/opendj-server-legacy/resource/bin/ldapdelete.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.LDAPDelete"
 set SCRIPT_NAME=ldapdelete
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/ldapmodify.bat b/opendj-server-legacy/resource/bin/ldapmodify.bat
index 51efe982..34826d9 100644
--- a/opendj-server-legacy/resource/bin/ldapmodify.bat
+++ b/opendj-server-legacy/resource/bin/ldapmodify.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.LDAPModify"
 set SCRIPT_NAME=ldapmodify
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/ldappasswordmodify.bat b/opendj-server-legacy/resource/bin/ldappasswordmodify.bat
index d244758..472d187 100644
--- a/opendj-server-legacy/resource/bin/ldappasswordmodify.bat
+++ b/opendj-server-legacy/resource/bin/ldappasswordmodify.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.LDAPPasswordModify"
 set SCRIPT_NAME=ldappasswordmodify
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/ldapsearch.bat b/opendj-server-legacy/resource/bin/ldapsearch.bat
index 2907c58..a4ef975 100644
--- a/opendj-server-legacy/resource/bin/ldapsearch.bat
+++ b/opendj-server-legacy/resource/bin/ldapsearch.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.LDAPSearch"
 set SCRIPT_NAME=ldapsearch
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/ldif-diff.bat b/opendj-server-legacy/resource/bin/ldif-diff.bat
index 862de57..4b3b4bf 100644
--- a/opendj-server-legacy/resource/bin/ldif-diff.bat
+++ b/opendj-server-legacy/resource/bin/ldif-diff.bat
@@ -19,6 +19,6 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.LDIFDiff"
 set SCRIPT_NAME=ldif-diff
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
 
 
diff --git a/opendj-server-legacy/resource/bin/ldifmodify.bat b/opendj-server-legacy/resource/bin/ldifmodify.bat
index ae76469..3bffa0f 100644
--- a/opendj-server-legacy/resource/bin/ldifmodify.bat
+++ b/opendj-server-legacy/resource/bin/ldifmodify.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.LDIFModify"
 set SCRIPT_NAME=ldifmodify
-for %%i in (%~sf0) do  call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/ldifsearch.bat b/opendj-server-legacy/resource/bin/ldifsearch.bat
index d055e85..dff7939 100644
--- a/opendj-server-legacy/resource/bin/ldifsearch.bat
+++ b/opendj-server-legacy/resource/bin/ldifsearch.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.LDIFSearch"
 set SCRIPT_NAME=ldifsearch
-for %%i in (%~sf0) do  call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/list-backends.bat b/opendj-server-legacy/resource/bin/list-backends.bat
index e35a46b..7767bfa 100644
--- a/opendj-server-legacy/resource/bin/list-backends.bat
+++ b/opendj-server-legacy/resource/bin/list-backends.bat
@@ -19,6 +19,6 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.ListBackends"
 set SCRIPT_NAME=list-backends
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
 
 
diff --git a/opendj-server-legacy/resource/bin/make-ldif.bat b/opendj-server-legacy/resource/bin/make-ldif.bat
index a9b6b4d..5ca5fdd 100644
--- a/opendj-server-legacy/resource/bin/make-ldif.bat
+++ b/opendj-server-legacy/resource/bin/make-ldif.bat
@@ -17,17 +17,17 @@
 
 setlocal
 
-for %%i in (%~sf0) do set NON_ESCAPED=%%~dPsi..
+set NON_ESCAPED=%~dp0..
 
 FOR /F "tokens=1-2* delims=%%" %%1 IN ("%NON_ESCAPED%") DO (
 if NOT "%%2" == "" goto invalidPath)
 
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
+set DIR_HOME=%~dp0..
 set INSTALL_ROOT=%DIR_HOME%
 
 set INSTANCE_DIR=
 if exist "%INSTALL_ROOT%\instance.loc" (
-  set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
+  set /p INSTANCE_DIR=<"%INSTALL_ROOT%\instance.loc"
 ) else (
 set INSTANCE_DIR=.
 )
diff --git a/opendj-server-legacy/resource/bin/manage-account.bat b/opendj-server-legacy/resource/bin/manage-account.bat
index 90f2ae4..d4b34c3 100644
--- a/opendj-server-legacy/resource/bin/manage-account.bat
+++ b/opendj-server-legacy/resource/bin/manage-account.bat
@@ -19,6 +19,6 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.ManageAccount"
 set SCRIPT_NAME=manage-account
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
 
diff --git a/opendj-server-legacy/resource/bin/manage-tasks.bat b/opendj-server-legacy/resource/bin/manage-tasks.bat
index 0dd1b90..57987df 100644
--- a/opendj-server-legacy/resource/bin/manage-tasks.bat
+++ b/opendj-server-legacy/resource/bin/manage-tasks.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.ManageTasks"
 set SCRIPT_NAME=manage-tasks
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 
diff --git a/opendj-server-legacy/resource/bin/rebuild-index.bat b/opendj-server-legacy/resource/bin/rebuild-index.bat
index e675663..4213b39 100644
--- a/opendj-server-legacy/resource/bin/rebuild-index.bat
+++ b/opendj-server-legacy/resource/bin/rebuild-index.bat
@@ -19,6 +19,6 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.RebuildIndex"
 set SCRIPT_NAME=rebuild-index
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
 
 
diff --git a/opendj-server-legacy/resource/bin/restore.bat b/opendj-server-legacy/resource/bin/restore.bat
index 04b4cce..d8d0cbc 100644
--- a/opendj-server-legacy/resource/bin/restore.bat
+++ b/opendj-server-legacy/resource/bin/restore.bat
@@ -19,6 +19,6 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.RestoreDB"
 set SCRIPT_NAME=restore
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_mixed-script.bat" %*
+call "%~dp0\..\lib\_mixed-script.bat" %*
 
 
diff --git a/opendj-server-legacy/resource/bin/start-ds.bat b/opendj-server-legacy/resource/bin/start-ds.bat
index 0585ece..d0b10a5 100644
--- a/opendj-server-legacy/resource/bin/start-ds.bat
+++ b/opendj-server-legacy/resource/bin/start-ds.bat
@@ -16,12 +16,12 @@
 rem Portions Copyright 2011-2014 ForgeRock AS.
 
 setlocal
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
+set DIR_HOME=%~dp0..
 set INSTALL_ROOT=%DIR_HOME%
 
 set INSTANCE_DIR=
 if exist "%INSTALL_ROOT%\instance.loc" (
-  set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
+  set /p INSTANCE_DIR=<"%INSTALL_ROOT%\instance.loc"
 ) else (
 set INSTANCE_DIR=.
 )
@@ -30,7 +30,7 @@
 cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
 cd /d %CUR_DIR%
-set TEMP_LOG="%TEMP%\logs\"
+set TEMP_LOG=%TEMP%\logs\
 
 if NOT EXIST "%INSTANCE_ROOT%\logs\" (
   if NOT EXIST "%TEMP_LOG%" (
diff --git a/opendj-server-legacy/resource/bin/status.bat b/opendj-server-legacy/resource/bin/status.bat
index 9fa233f..18d7e3d 100644
--- a/opendj-server-legacy/resource/bin/status.bat
+++ b/opendj-server-legacy/resource/bin/status.bat
@@ -19,4 +19,4 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.status.StatusCli"
 set SCRIPT_NAME=status
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
diff --git a/opendj-server-legacy/resource/bin/stop-ds.bat b/opendj-server-legacy/resource/bin/stop-ds.bat
index 0fdfc38..20158d7 100644
--- a/opendj-server-legacy/resource/bin/stop-ds.bat
+++ b/opendj-server-legacy/resource/bin/stop-ds.bat
@@ -21,7 +21,7 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.StopDS"
 set SCRIPT_NAME=stop-ds
-for %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
+set DIR_HOME=%~dp0..
 
 rem We keep this values to reset the environment before calling start-ds.
 set ORIGINAL_JAVA_ARGS=%OPENDJ_JAVA_ARGS%
@@ -32,16 +32,16 @@
 
 set INSTANCE_DIR=
 if exist "%INSTALL_ROOT%\instance.loc" (
-  set /p INSTANCE_DIR=<%INSTALL_ROOT%\instance.loc
+  set /p INSTANCE_DIR=<"%INSTALL_ROOT%\instance.loc"
 ) else (
 set INSTANCE_DIR=.
 )
 set CUR_DIR=%CD%
-cd /d%INSTALL_ROOT%
-cd /d%INSTANCE_DIR%
+cd /d %INSTALL_ROOT%
+cd /d %INSTANCE_DIR%
 set INSTANCE_ROOT=%CD%
-cd /d%CUR_DIR%
-set TEMP_LOG="%TEMP%\logs\"
+cd /d %CUR_DIR%
+set TEMP_LOG=%TEMP%\logs\
 
 if NOT EXIST "%INSTANCE_ROOT%\logs\" (
   if NOT EXIST "%TEMP_LOG%" (
diff --git a/opendj-server-legacy/resource/bin/verify-index.bat b/opendj-server-legacy/resource/bin/verify-index.bat
index d1c3619..fbc6c89 100644
--- a/opendj-server-legacy/resource/bin/verify-index.bat
+++ b/opendj-server-legacy/resource/bin/verify-index.bat
@@ -19,6 +19,6 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.VerifyIndex"
 set SCRIPT_NAME=verify-index
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_server-script.bat" %*
+call "%~dp0\..\lib\_server-script.bat" %*
 
 
diff --git a/opendj-server-legacy/resource/bin/windows-service.bat b/opendj-server-legacy/resource/bin/windows-service.bat
index b394f39..1862684 100644
--- a/opendj-server-legacy/resource/bin/windows-service.bat
+++ b/opendj-server-legacy/resource/bin/windows-service.bat
@@ -19,5 +19,5 @@
 
 set OPENDJ_INVOKE_CLASS="org.opends.server.tools.ConfigureWindowsService"
 set SCRIPT_NAME=windows-service
-for %%i in (%~sf0) do call "%%~dPsi\..\lib\_client-script.bat" %*
+call "%~dp0\..\lib\_client-script.bat" %*
 

--
Gitblit v1.10.0