for /f %%i in ('dir /b *.html') do (
<execute some command on each html file>
)
in case of error (Do you wish to continue [Y/N] message how do i do an
equivalent of "continue" in batch scripting.
i could do something like this after the command statement inside the
loop:
if errorlevel 1 goto start (where start is label before the command
statment)
will this make the loop variable to skip to the next value??
also does the label need to be before 'do' or before the first
statement in the do loop??
any help would be greatly appreciated.
THanks.
> will this make the loop variable to skip to the next value??
> also does the label need to be before 'do' or before the first
> statement in the do loop??
>
No, the for in do is fixed. Maybe a different construct fits better.
You can call a sub routine in the do part and exit at different points or
work with conditional execution || resp. && based on errors.
@echo off
for /f %%i in ('dir /b *.html') do call :sub "%%i"
goto :eof
:sub
REM in the sub the passed argument (%%i) is %1
:: execute some command on each html file
if errorlevel 1 echo an error occured&goto :eof
:: execute some other commands
goto :eof
--
Greetings
Matthias