The following code snippet works fine in Win2K and probably XP, but
what is equivalent code in NT4?
---
set CLP=.
for %%x in (.\lib\*.jar) do set CLP=!CLP!;%%x
---
So afterwards CLP is equal to all the jar files in the lib directory,
seperated by a semicolon (ie, making a Java classpath).
This doesn't work in NT4 because it relies on a feature only
introduced in Win2K, the ability to reevaluate CLP on each iteration
of the loop. In NT4 CLP is set to "." at the beginning and stays that
value the duration of the script.
I've searched everywhere and read many batch scripting references
(almost all just cover very basic things) and am still stuck. If
anyone has an idea I'd appreciate it. Thank you.
Thanks
Maybe something like
set CLP=.
for %%x in (.\lib\*.jar) do call :sub %%x
goto :EOF
:sub
set CLP=%CLP%;%1
goto :EOF
--
Phil Robyn
Univ. of California, Berkeley
u n z i p m y a d d r e s s t o s e n d e - m a i l
That worked great. Thanks!
Matt
%.ForExpand% %%A IN ('SET VariableName') DO ([Command] %%B)
%%A = VariableName
%%B = Dynamically calculated CONTENTS of VariableName
*******
Using your example:
1. SET CLP=.
2. FOR %%x IN (.\lib\*.jar) DO @(
3. %.ForExpand% %%y IN ('SET CLP') DO @(
4. (SET CLP=%%z;%%x)
5. )
6. )
These self-documenting lines will produce a semicolon delimited list of
files matching
.\lib\*.jar
and store those file names in the variable %CLP%.
See the .ForExpand page at
(http://TheSystemGuard.com/MtCmds/CommandShorthand/ForExpand.htm) for
color-keyed examples.
*******
Notes:
1. .Mount/\Commands are constructed using ONLY builtin
commands common to all four platforms (NT/2K/XP/K3).
2. .M/\C's are NOT case sensitive. Mixed case is used
for visual clarity only.
3. The Advanced NT/2K/XP/K3 Command Library (ntlib.cmd)
provides over 100 resources to assist with
writing and documenting cross-platform scripts,
including 57 .Mount/\Commands. You can obtain it
(for FREE) at (http://ntlib.com).
*******
-tsg
____________________________________________________________
TheSystemGuard.com | BoomingOrFuming.com | MountCommands.com
Free and "Almost Free" Knowledge for Windows System Admins!
"Matt Greer" <mgre...@yahoo.com> wrote in message
news:dfd58f68.03070...@posting.google.com...