I have loop which searching all folders, loop have also condition which checking if folder name is different then specified than do something.
Unfortunately some folder have white space in name and my condition doesn’t work
This is my script
Code: Select all
set name1=folder a1
for /f "delims=" %%a in ('dir /b/ad') do (
if not %%a==folder1 if not %%a==folder2 if not %%a==%name1% (
rem do something
)
)
After when I added “if not %%a==%name1%” in condition all condition stop working because there is a problem with white space in folder name.
How to resolve this problem?