@echo off :: by default, assume English set PROGNAME=Fedora Librarian Interface if "%GLILANG%" == "es" set PROGNAME=Biblioteca Digital Fedora. if "%GLILANG%" == "fr" set PROGNAME=Bibliothécaire Fedora. if "%GLILANG%" == "ru" set PROGNAME=ÉÎÔÅÒÆÅÊÓ Fedora. :: How to export PROGNAME? set PROGNAME_EN=Fedora Librarian Interface set PROGABBR=FLI :: Test to see if FEDORA2 environment variables have been set up if "%FEDORA2_HOME%" == "" goto chkFed3 :: Else FEDORA2_HOME exists testing if the directory FEDORA2_HOME exists :: MAN: Can't use the if command to test directly for a directory, but the null (NUL) device does exist in :: every directory. As a result, you can test for the null device to determine whether a directory exists. if not exist %FEDORA2_HOME%\nul echo Error: Cannot find Fedora-2 home: No such directory %FEDORA2_HOME% if not exist %FEDORA2_HOME%\nul goto exit :: Otherwise FEDORA2_HOME exists and refers to a directory set FEDORA_HOME=%FEDORA2_HOME% :: MAN: The %* batch parameter is a wildcard reference to all the arguments, not including %0, :: that are passed to the batch file. gli.bat -fedora_home %FEDORA2_HOME% %* :: Test to see if FEDORA3 environment variables have been set up :chkFed3 if "%FEDORA3_HOME%" == "" echo Error: Cannot find Fedora-3 home or Fedora-2 home. if "%FEDORA3_HOME%" == "" echo Have you set the environment variable 'FEDORA3_HOME' or 'FEDORA2_HOME'? if "%FEDORA3_HOME%" == "" goto exit :: Otherwise, FEDORA3_HOME has been set, check if it's a directory: if not exist %FEDORA3_HOME%\nul echo Error: Cannot find Fedora-3 home: No such directory %FEDORA3_HOME% if not exist %FEDORA3_HOME%\nul goto exit :: Otherwise FEDORA2_HOME exists and refers to a directory set FEDORA_HOME=%FEDORA3_HOME% gli.bat -fedora_home %FEDORA3_HOME% %* :exit echo. pause :done :: ---- Clean up ---- set PROGNAME_EN= set PROGABBR= set PROGNAME=