Under clean Windows XP, under Administrator account. Default temp dir is like c:\Documents and Settings\Admin\Local Settings\TEMP In catalina.bat there is a temp dir check: if ""%TEMP%"" == """" goto mainEntry Actually, this command does not work if TEMP contains spaces. The right line is: if ""%TEMP%"" == """" goto mainEntry i.e. to avoid double quoting
It is funny. I have WinXP. The "TEMP" variable is configured as %USERPROFILE%\Local Settings\Temp by default for the current user in the setting dialog (Win+Pause), but cmd shows > echo %TEMP% C:\DOCUME~1\username\LOCALS~1\Temp So the current catalina.bat already works for majority of Windows XP users, including me.
There is a known issue under XP http://social.technet.microsoft.com/Forums/zh/itproxpsp/thread/a4f428ba-1826-46a0-999a-972ae4279fbe
Given that %TEMP% may or may not contain spaces ad may or may not be quoted I simply do not see a way of getting this to work for all possible input. I'd be happy to be proved wrong though.
AFAICT it's not possible using IF because one cannot get past the syntax error that occurs when the quotes are mismatched. However, I think I've found a solution. Try the following: REM The output of ECHO will be :: if TEMP is not defined REM It's not possible for :: to be found within a valid TEMP variable echo :%TEMP%: | find "::" REM check for level 0, i.e. pattern found if NOT ERRORLEVEL 1 goto mainEntry
Neat trick. While that fixes the first problem, a similar approach can't be used for the following lines that use IF and %TEMP%.
We could detect the spaces in %TEMP% and issue an error message, stopping the startup script rather than ending up giving the user a bizarre error and letting them try to figure it out.
Please remember the possible issue with Windows XP: http://social.technet.microsoft.com/Forums/zh/itproxpsp/thread/a4f428ba-1826-46a0-999a-972ae4279fbe For some reason/bug path to %TEMP% may be not 8.3 style formatted. This simply makes catallina.bat fail and not start Tomcat. I faced exactly the same issue on my test Windows XP VM.
There is no way I am aware of to fix this. See comment #3. Please do not re-open this issue unless you have a patch that actually fixes the issue.
(In reply to comment #3) I think %TEMP% do not use quotes, like ones are not used in %PATH%. The OS cares that %TEMP% do not contain spaces, and thus it would not be quoted. You naturally do not use quotes when you configure values through GUI. The syntax for SET command is less intuitive. For reference: SET "TEMP=value" [Offtopic] Regarding that thread on social.technet.microsoft.com I would say that - The value of NtfsDisable8dot3NameCreation affects the time when a directory is created (in that case: when a profile is created), not when it is used. That is whether mkdir generates two names or just one. - Setting TEMP to C:\Temp is a valid workaround for the issue.
Fixed in trunk and 7.0 by r1344725 and r1344732 and will be in 7.0.28. Note that - The issue only affects the "run" command. All other command skip that code. - The issue affects 7.0.x only. Earlier versions do not have that code in catalina.bat.
(In reply to comment #9) > (In reply to comment #3) ... > You naturally do not use quotes when you configure values through GUI. > The syntax for SET command is less intuitive. For reference: > > SET "TEMP=value" > On WinXP, the command: SET TEMP1=a b c is the same as SET "TEMP2=a b c" Neither adds quotes to the value of X. However, the following command does add quotes: SET TEMP3="a b c" The result of the above is: TEMP1=a b c TEMP2=a b c TEMP3="a b c"
AFAICT, the TEMP directory is being used for two purposes: 1) for a file containing "Y" 2) as a marker to stop a recursive call of catalina.bat The first use is trivial to eliminate; just ship Tomcat with a suitable file The second use can also be eliminated. If you can assume that Command Extensions are enabled, the following will work: rem Suppress Terminate batch job on CTRL+C if not ""%1"" == ""run"" goto mainEntry if ""%TEMP%"" == """" goto mainEntry rem Assumes Y.DAT exists call :mainEntry %* <Y.DAT rem Use provided errorlevel set RETVAL=%ERRORLEVEL% exit /B %RETVAL% :mainEntry If not, then rather than using a marker file in TEMP, you can use a SET variable: rem Suppress Terminate batch job on CTRL+C if not ""%1"" == ""run"" goto mainEntry if ""%TEMP%"" == """" goto mainEntry if ""%_RECURSE_%"" == ""TrUe"" goto mainEntry set _RECURSE_=TrUe call "%~f0" %* <Y.DAT rem Use provided errorlevel set RETVAL=%ERRORLEVEL% set _RECURSE_= exit /B %RETVAL% :mainEntry Yet another possibility is to split catalina.bat into two so the mainEntry code is in a separate file. This solves the recursive call issue.