Index: /gli/trunk/gli.bat
===================================================================
--- /gli/trunk/gli.bat	(revision 15353)
+++ /gli/trunk/gli.bat	(revision 15354)
@@ -101,7 +101,7 @@
 
     :: Check if Perl is on the search path
-    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
-    call setperl.bat
-    del setperl.bat
+    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
+    call %TMP%\setperl.bat
+    del %TMP%\setperl.bat
     if not "%PERLPATH%" == "" goto testPerl
 
@@ -110,13 +110,13 @@
 
     :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > perl.reg
-    regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
-    type perl.reg > perl.txt
-    del perl.reg
-
-    winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
-    del perl.txt
-    call setperl.bat
-    del setperl.bat
+    type nul > %TMP%\perl.reg
+    regedit /E %TMP%\perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
+    type %TMP%\perl.reg > %TMP%\perl.txt
+    del %TMP%\perl.reg
+
+    winutil\findperl.exe %TMP%\perl.txt | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
+    del %TMP%\perl.txt
+    call %TMP%\setperl.bat
+    del %TMP%\setperl.bat
 
     :: If nothing was found in the registry, we're stuck
@@ -174,24 +174,24 @@
 
     :: 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
+    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > %TMP%\setjava.bat
+    call %TMP%\setjava.bat
+    del %TMP%\setjava.bat
     if not "%JAVAPATH%" == "" goto testJava
 
     :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > jdk.reg
-    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
-    type jdk.reg > jdk.txt
-    del jdk.reg
-    type nul > jre.reg
-    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
-    type jre.reg > jre.txt
-    del jre.reg
-
-    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
-    del jdk.txt
-    del jre.txt
-    call setjava.bat
-    del setjava.bat
+    type nul > %TMP%\jdk.reg
+    regedit /E %TMP%\jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
+    type %TMP%\jdk.reg > %TMP%\jdk.txt
+    del %TMP%\jdk.reg
+    type nul > %TMP%\jre.reg
+    regedit /E %TMP%\jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
+    type %TMP%\jre.reg > %TMP%\jre.txt
+    del %TMP%\jre.reg
+
+    winutil\findjava.exe %TMP%\jdk.txt %TMP%\jre.txt | winutil\setvar.exe JAVAPATH > %TMP%\setjava.bat
+    del %TMP%\jdk.txt
+    del %TMP%\jre.txt
+    call %TMP%\setjava.bat
+    del %TMP%\setjava.bat
 
     :: If nothing was found in the registry, we're stuck
Index: /gli/trunk/gli4gs3.bat
===================================================================
--- /gli/trunk/gli4gs3.bat	(revision 15353)
+++ /gli/trunk/gli4gs3.bat	(revision 15354)
@@ -84,7 +84,7 @@
 :: Setup Greenstone 3, unless it has already been done
 if not "%GSDL3SRCHOME%" == "" goto doneGSDL3
-    cd | winutil\setvar.exe GLIDIR > setgli.bat
-    call setgli.bat
-    del setgli.bat
+    cd | winutil\setvar.exe GLIDIR > %TMP%\setgli.bat
+    call %TMP%\setgli.bat
+    del %TMP%\setgli.bat
     cd "%GSDL3PATH%"
     call gs3-setup.bat SetEnv > nul
@@ -149,7 +149,7 @@
 
     :: Check if Perl is on the search path
-    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
-    call setperl.bat
-    del setperl.bat
+    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
+    call %TMP%\setperl.bat
+    del %TMP%\setperl.bat
     if not "%PERLPATH%" == "" goto testPerl
 
@@ -158,13 +158,13 @@
 
     :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > perl.reg
-    regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
-    type perl.reg > perl.txt
-    del perl.reg
-
-    winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
-    del perl.txt
-    call setperl.bat
-    del setperl.bat
+    type nul > %TMP%\perl.reg
+    regedit /E %TMP%\perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
+    type %TMP%\perl.reg > %TMP%\perl.txt
+    del %TMP%\perl.reg
+
+    winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
+    del %TMP%\perl.txt
+    call %TMP%\setperl.bat
+    del %TMP%\setperl.bat
 
     :: If nothing was found in the registry, we're stuck
@@ -218,24 +218,24 @@
 
     :: 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
+    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > %TMP%\setjava.bat
+    call %TMP%\setjava.bat
+    del %TMP%\setjava.bat
     if not "%JAVAPATH%" == "" goto testJava
 
     :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > jdk.reg
-    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
-    type jdk.reg > jdk.txt
-    del jdk.reg
-    type nul > jre.reg
-    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
-    type jre.reg > jre.txt
-    del jre.reg
-
-    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
-    del jdk.txt
-    del jre.txt
-    call setjava.bat
-    del setjava.bat
+    type nul > %TMP%\jdk.reg
+    regedit /E %TMP%\jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
+    type %TMP%\jdk.reg > %TMP%\jdk.txt
+    del %TMP%\jdk.reg
+    type nul > %TMP%\jre.reg
+    regedit /E %TMP%\jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
+    type %TMP%\jre.reg > %TMP%\jre.txt
+    del %TMP%\jre.reg
+
+    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > %TMP%\setjava.bat
+    del %TMP%\jdk.txt
+    del %TMP%\jre.txt
+    call %TMP%\setjava.bat
+    del %TMP%\setjava.bat
 
     :: If nothing was found in the registry, we're stuck
