#1 23 Dec 2019 07:24

PiotrMP006
Member
Registered: 02 Apr 2019
Posts: 10

How do I find an error in the for loop if there is no directory found?

How do I find an error in the for loop if there is no directory found?

ex.

for /f "tokens=*" %%a in ('dir "%cd%" /a:d /b 2^> nul') do (
echo %%a
)

%errorlevel% always is 0

Please help me

Last edited by PiotrMP006 (23 Dec 2019 07:25)

Offline

Board footer

Powered by FluxBB