for /f "tokens=*" %%n in ('dir /s/b %1\*mydir*') do call :A1 "%%n"
:A1
pushd %~1
for %%D in (*myfile*.txt) do ( for /f "tokens=1 delims=+" %%H in ("%%~nD") do (
.. do stuff
goto do
)
)
:do
..do stuff
popd
:end
In the for %%D in .. line, how to skip "*myfile*.txt files that has the word "EPQ" in them?.
ignore files
Moderator: DosItHelp
Re: ignore files
glob5 wrote:In the for %%D in .. line, how to skip "*myfile*.txt files that has the word "EPQ" in them?.
Code: Select all
for %%D in (*myfile*.txt) do (
findstr "EPQ" "%%D">nul|| for /f "tokens=1 delims=+" %%H in ("%%~nD") do (
echo %%H
)
)
- "goto do" command interrupt FOR loop in first pass, only one file processed;
- each "CALL :SUB" command must be ended with GoTo:EOF in SUB procedure.