Index: /trunk/gsdl3/gs3-server.bat
===================================================================
--- /trunk/gsdl3/gs3-server.bat	(revision 13552)
+++ /trunk/gsdl3/gs3-server.bat	(revision 13553)
@@ -2,38 +2,41 @@
 set SERVERLANG=en
 
+:: -------- Run the Greenstone 3 Server --------
+
 :: This script must be run from within the directory in which it lives
 if exist gs3-server.bat goto start
-    if "%SERVERLANG%" == "en" echo This script must be run from the directory in wh
-ich it resides.
-    if "%SERVERLANG%" == "es" echo Este gui<A2>n deber<A0> ejecutarse desde el dire
-ctorio en el que reside.
-    if "%SERVERLANG%" == "fr" echo Ce script doit <88>tre ex<82>cut<82> <85> partir
- du r<82>pertoire dans lequel il se trouve.
-    if "%SERVERLANG%" == "ru" echo <9D><E2><AE><E2> <E1><AA><E0><A8><AF><E2> <A4>
-<AE><AB><A6><A5><AD> <A1><EB><E2><EC> <A2><A7><EF><E2> <A8><A7> <A4><A8><E0><A5>
-<AA><E2><AE><E0><A8><A8>, <A2> <AA><AE><E2><AE><E0><AE><A9> <AE><AD> <E0><A0>
-<E1><AF><AE><AB><AE><A6><A5><AD>
+    if "%SERVERLANG%" == "en" echo This script must be run from the directory in which it resides.
+    if "%SERVERLANG%" == "es" echo Este guiÂ¢n deberÂ  ejecutarse desde el directorio en el que reside.
+    if "%SERVERLANG%" == "fr" echo Ce script doit Ëtre exâcutâ âŠ partir du râpertoire dans lequel il se trouve.
+    if "%SERVERLANG%" == "ru" echo ÂÃ¢Â®Ã¢ Ã¡ÂªÃ ÂšÂ¯Ã¢ Â€Â®Â«ÂŠÂ¥Â­ Â¡Ã«Ã¢Ã¬ Â¢Â§Ã¯Ã¢ ÂšÂ§ Â€ÂšÃ Â¥ÂªÃ¢Â®Ã ÂšÂš, Â¢ ÂªÂ®Ã¢Â®Ã Â®Â© Â®Â­ Ã Â Ã¡Â¯Â®Â«Â®ÂŠÂ¥Â­
     goto exit
 
+:start
+if "%OS%" == "Windows_NT" goto findGSDL
+    :: Invoke a new command processor to ensure there's enough environment space
+    if "%1" == "Second" goto findGSDL
+        command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
+        goto done
+
+:findGSDL
 echo.
-echo "Greenstone 3 Server"
-echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-echo "This software comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
-echo "This is free software, and you are welcome to redistribute it"
-echo.
+if "%SERVERLANG%" == "en" echo Greenstone3 Server
+if "%SERVERLANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
+if "%SERVERLANG%" == "en" echo This program comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
+if "%SERVERLANG%" == "en" echo This is free software, and you are welcome to redistribute it
 
 echo.
-::  ---- Determine GSDLHOME ----
+::  ---- Determine GSDL3HOME ----
 set GSDL3PATH=
 
 :: Some users may set the above line manually
-if not "%GSDL3PATH%" == "" goto prepGSDL
+ if not "%GSDL3PATH%" == "" goto prepGSDL
 
-    :: The default location is the current directory
-    set GSDL3PATH=.
+ :: The default location is the current directory
+ set GSDL3PATH=.
 
-    :: If it is set, use the GSDLHOME environment variable
-    if "%GSDL3HOME%" == "" goto prepGSDL
-        set GSDL3PATH=%GSDL3SRCHOME%
+ :: If it is set, use the GSDLHOME environment variable
+  if "%GSDL3SRCHOME%" == "" goto prepGSDL
+  set GSDL3PATH=%GSDL3SRCHOME%
 
 :prepGSDL
@@ -46,19 +49,19 @@
 set GSDL3PATH=
 
-findJava
+:findJava
 :: ---- Check Java exists ----
-set JAVAPATH=
+set JAVAPATH=c:\j2sdk1.4.2_12\bin
 
 :: Some users may set the above line manually
 if not "%JAVAPATH%" == "" goto testJava
 
-    :: If it is set, use the JAVA_HOME environment variable
-    if not "%JAVA_HOME%" == "" goto javahome
+:: If it is set, use the JAVA_HOME environment variable
+ if not "%JAVA_HOME%" == "" goto javahome
 
-    :: Check if Java is on the search path
-    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
-    call setjava.bat
-    del setjava.bat
-    if not "%JAVAPATH%" == "" goto testJava
+:: Check if Java is on the search path
+ echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
+ call setjava.bat
+ del setjava.bat
+ if not "%JAVAPATH%" == "" goto testJava
 
     :: Still haven't found anything, so try looking in the registry (gulp!)
@@ -89,29 +92,25 @@
 :testJava
 :: Check that a Java executable has been found
-if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
-if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
-if "%GLILANG%" == "fr" echo V<82>rification de Java: %JAVAPATH%
-if "%GLILANG%" == "ru" echo <8F><E0><AE><A2><A5><E0><AA><A0> Java: %JAVAPATH%
-if exist "%JAVAPATH%\java.exe" goto checkGLI
+  if "%SERVERLANG%" == "en" echo Checking Java: %JAVAPATH%
+  if "%SERVERLANG%" == "es" echo Revisando Java: %JAVAPATH%
+  if "%SERVERLANG%" == "fr" echo Vârification de Java: %JAVAPATH%
+  if "%SERVERLANG%" == "ru" echo ÂÃ Â®Â¢Â¥Ã ÂªÂ  Java: %JAVAPATH%
+  if exist "%JAVAPATH%\java.exe" goto checkServer
 
 :noJava
-echo.
-echo Failed to locate an appropriate version of Java. You must install a
-echo Java Runtime Environment (version 1.4 or greater) before running the
-echo Greenstone Server.
-
-goto exit
+ echo.
+    if "%SERVERLANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
+    if "%SERVERLANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
+    if "%SERVERLANG%" == "en" echo Greenstone3 Server.
+    goto exit
 
 :checkServer
----- Check that the server program has been compiled ----
+::---- Check that the server program has been compiled ----
 if exist "server.jar" goto runServer
-
-echo "You need to compile the code before running the server"
+if "%SERVERLANG%" == "en" echo "You need to compile the code before running the server"
 goto exit
 
 :runServer
-
 echo Running the Greenstone Server
-
 :: -Xms32M          To set minimum memory
 :: -Xmx32M          To set maximum memory
@@ -123,4 +122,11 @@
 "%JAVAPATH%\java" -cp %CLASSPATH% org.greenstone.server.Server "%GSDL3SRCHOME%"
 
+:exit
+
+:done
+:: ---- Clean up ----
+set JAVAPATH=
+
+
 
  
