[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Corrected Windows-Batch files
Hello,
because of the discussions about W-batch files I have rewritten
all of them. The work is based on ideas from the ant-build system
(especially collecting .jar files in a classpath). Important is:
(1) The ANT_HOME, OZONE_HOME, PROWLER_HOME variables must be set and
should point to the respective installation paths.
(2) A batch file must not change the CLASSPATH variable.
Some hints:
= Setting the ..._HOME variables in your environment makes the
scripts very happy ;-)
==> unter Win9x in your autoexec.bat, i.e.:
SET ANT_HOME=d:\home\jakarta\ant
SET PATH=%PATH%;%ANT_HOME%\bin
SET OZONE_HOME=d:\home\infozone\ozone\0.5.5
SET PATH=%PATH%;%OZONE_HOME%\bin
SET PROWLER_HOME=d:\home\infozone\prowler\0.3
SET PATH=%PATH%;%PROWLER_HOME%\bin
==> under WinNT through a setenv.bat:
If you like to use such a batch file, think about automatic or
background starts. In these cases often you must modify
the startup files which is hard to maintain.
==> under WinNT through a setenv.reg:
Do you think, you can use such a .reg file? Bahhh... it doesn't
works with REG_EXPAND_SZ values:
http://support.microsoft.com/support/kb/articles/Q186/1/46.ASP?LN=EN-US&SD=gn&FR=0
So you must have a regini.exe (you will find it in your
WinNT resource kit) or you must set all of the values by hand
in your desktop properties.
Here is a possible initialization file for regini.exe:
<file name="env.ini" type="inifile" usage="regini env.ini">
<remarks>
= Changes will be active until logoff/logon!
= The use of _JAVA_HOME=>CLASSPATH instead of JAVA_HOME=>CLASSPATH
is (on my computer) necessary due to a incorrect variable expansion
(it expands to CLASSPATH=%JAVA_HOME%). It seems to be that the
variable expansion ***sometimes*** not properly works if a variable which
is used in a expansion is defined after this expansion
- note: ***sometimes***:
A=hello_A
H=%A%;%Z%
Z=hello_Z
H can have the value: hello_A;%Z%
</remarks>
<content>
HKEY_CURRENT_USER\Environment
_JAVA_HOME = REG_SZ D:\Programme\JavaSoft\j2sdk\se\1.2.2
JAVA_HOME = REG_EXPAND_SZ %_JAVA_HOME%
CLASSPATH = REG_EXPAND_SZ %_JAVA_HOME%\lib\tools.jar
_ANT_HOME = REG_SZ D:\home\infozone\ozone\0.5.5
_OZONE_HOME = REG_SZ D:\home\infozone\ozone\0.5.5
_PROWLER_HOME = REG_SZ D:\home\infozone\prowler\0.3
ANT_HOME = REG_EXPAND_SZ %_ANT_HOME%
OZONE_HOME = REG_EXPAND_SZ %_OZONE_HOME%
PROWLER_HOME = REG_EXPAND_SZ %_PROWLER_HOME%
PATH = REG_EXPAND_SZ %_JAVA_HOME%\bin;%_ANT_HOME%\bin;%_OZONE_HOME%\bin;%_PROWLER_HOME%\bin
</content>
</file>
Best regards,
andy
--
************************************************************************
* Andreas Kasparz - andy@interface-business.de - +49 351 31809 0 *
* Interface-Business GmbH, Tolkewitzer Str. 49, 01277 Dresden, Germany *
************************************************************************
batchfiles.tar.gz