@echo off& setlocal enableextensions enabledelayedexpansion
(set raw=.CR2)& rem Canon EOS 30D
goto:_Database
...SNIP
Since it's 01/01/2007, I would first say "happy new year", then say
that I don't read my e-mails...
The syntax "set errorlevel=something..." could be dangerous when
it's used/mixed with some of the older syntax such as
"if errorlevel something..."
I knew that a syntax such as COLOR 07 would set the errorlevel to 0
and that COLOR 11 would set the errorlevel to 1, but when I found the
solution (set errorlevel=), then I forgot to evaluate previous syntax,
so if you already had (set errorlevel=) somewhere in a batch file,
and then later repeat that reset, the last one would set the error
level to 1, ofcause. In other words: it should be followed by a
color 07, or set another variable to something except nothing, ex:
(set errorlevel=)&(set variable=X)
So the solution for CMD files is simply this:
set errorlevel=& color 07& rem -- reset, AND set both errorlevels to 0.
Benny Pedersen,
PS. Havn't the point, so
Try the following with an extension CMD, (BAT extension would fail)...
@echo off
(SET A=)
if errorlevel 1 if not errorlevel 2 echo ER is 1,
echo %%ER%% = %errorlevel%, so errorlevel is 1.& echo.
color 07& rem -- bgcolor and errorlevel is now set to 0.
if not errorlevel 1 echo ER is 0,
echo %%ER%% = %errorlevel%, so errorlevel is 0.& echo.
(SET A=)
if errorlevel 1 if not errorlevel 2 echo ER is 1,
echo %%ER%% = %errorlevel%, so errorlevel is 1.& echo.
(set errorlevel=0)
if not errorlevel 1 echo ER is 0,
echo %%ER%% = %errorlevel%, so errorlevel is 0.& echo.
color 11& rem -- errorlevel is now set to 1.
if not errorlevel 1 echo ER is 0.
if errorlevel 1 echo ER is 1...
echo %%ER%% = %errorlevel%, BUT errorlevel is 1.& echo.
(set errorlevel=)& rem OOPS.
set errorlevel=& color 07& rem Reset, AND set both errorlevels to 0.
pause
goto:eof
Btw. I'm working on a new batch file to handle the XMP files for
Adobe Photoshop and PSE, and it work very fine.
Security and stability - No data should be deleted. Fact is that
a child should be able to use it, and even if my cat was walking
on my keyboard, this my new batch file should not fail...
So why use the ugly Abobe Database when shooting RAW files...
I will later upload my new CMD file to this forum:
http://www.photoshopelementsuser.com/forum/showthread.php?t=17609
:XMP
echo. Create XMP Sidecar, from
echo.
echo. 0: Default ^(Empty XMP files^)
echo. 1: Internal Template
echo. 2: External Template
echo. 3: Previous
echo.
echo. 4: Cleanup ^(Delete XMP files that's not used^)
:_0
for %%R in ("%~dp1*%raw%") do (
echo Creating "%%~dpnR.XMP"
type nul > "%%~dpnR.XMP"
)
...SNIP...