Hi All,
I'm getting an error while trying to run the below batch file.
rem @echo off
rem if "%PRINTLN%xxx"=="xxx" set PRINTLN=FALSE
if NOT "%1" == "" set DBUSJMS_ROOT=%1
if NOT "%DBUSJMS_ROOT%xxx" == "xxx" goto checkRootDir
goto Usage
:checkRootDir
if exist %DBUSJMS_ROOT% goto dbusEnv
@echo path DBUSJMS_ROOT=%DBUSJMS_ROOT% do no exists
goto Usage
:dbusEnv
REM
REM allow scripts to add to path variables
REM
set ADD_PATH=TRUE
REM
REM set up makedir environment
REM
@echo DBUSJMS_ROOT=%DBUSJMS_ROOT%
set ARCH=NT4.0
set MAJOR_VERSION=3
set MINOR_VERSION=0
set MINOR_MINOR_VERSION=0
set VERSION_STRING=%MAJOR_VERSION%.%MINOR_VERSION%.%MINOR_MINOR_VERSION%
set CC_BUILD_WANTED=6.0
if .%CC_BUILD% == . goto SET_CC_BUILD
if %CC_BUILD% == %CC_BUILD_WANTED% goto SET_CC_BUILD
echo Your CC_BUILD environment variable points to
echo C++ compiler version %CC_BUILD% which is not
echo supported by dBus %VERSION_STRING%
echo If you need to use other dBus product requiring CC_BUILD=%CC_BUILD%
echo please get a version of it compatible with %VERSION_STRING%
echo Otherwise please clear CC_BUILD environment variable and run
echo dbusEnv.bat again
goto myExit
:SET_CC_BUILD
set CC_BUILD=%CC_BUILD_WANTED%
@echo DBUSJMS_ROOT=%DBUSJMS_ROOT%
@echo ARCH=%ARCH%
@echo CC_BUILD=%CC_BUILD%
if NOT "%DBVITRIA_BUILD%xxx"=="xxx" @echo DBVITRIA_BUILD=%DBVITRIA_BUILD%
set DB_BUILD_VER=_%MAJOR_VERSION%_%MINOR_VERSION%
rem Define Standard Standard Path
echo "Hello1"
call %DBUSJMS_ROOT%\bin\%ARCH%\addPath %DBUSJMS_ROOT%\scripts
echo "hello2"
call %DBUSJMS_ROOT%\bin\%ARCH%\addPath %DBUSJMS_ROOT%\bin\%ARCH%
call %DBUSJMS_ROOT%\bin\%ARCH%\addPath %DBUSJMS_ROOT%\%ARCH%\%CC_BUILD%\bin
rem Define Standard Standard ClassPath
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\jcert.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\jndi.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\jsse.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\tibcrypt.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\tibjmsadmin.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\tibrvjms.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\jms.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\jnet.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\jta-spec1_0_1.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\tibjms.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\tibjms.3.1\jars\%ARCH%\tibjmsapps.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\jars\%ARCH%\dbUtils_3_0.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\jars\%ARCH%\dbNaming_3_0.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\jars\log4j.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\jars\%ARCH%\dbusJms_3_0.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\jars\%ARCH%\dbusJmsSamples_3_0.jar
call %DBUSJMS_ROOT%\bin\%ARCH%\addClassPath %DBUSJMS_ROOT%\classes\%ARCH%
goto end
:Usage
@echo Usage: %0 DBUSJMS_ROOT
goto myExit
:end
set TMPVAR=%DBUSJMS_ROOT:~3,10%
echo "\n=======DBUS PATH================"
dumppath | grep %TMPVAR%
echo "=======DBUS Class Path ================"
classpath | grep %TMPVAR%
echo "==================================================="
:myExit
-------------------End of File----------------------------
I'm getting the error after "hello1". It is not going to 'hello2". The error given is \Windows was unexpected at this time.
Please help me on this. The same batch file is running on a different server correctly.
Thanks
\Windows was unexpected at this time.
Moderator: DosItHelp
Re: \Windows was unexpected at this time.
Try this kind of debugging and see what the command echos to the console. There could be long filename elements in the path, like spaces etc.
echo "Hello1"
ECHO call %DBUSJMS_ROOT%\bin\%ARCH%\addPath %DBUSJMS_ROOT%\scripts
echo "hello2"
pause
echo "Hello1"
ECHO call %DBUSJMS_ROOT%\bin\%ARCH%\addPath %DBUSJMS_ROOT%\scripts
echo "hello2"
pause