Solved IF Loop in FOR Loop - Batch script

July 10, 2012 at 15:08:01
Specs: Windows XP
As of now i perform a operation using batch like below.

FOR /D %%G in ("*") DO command

-- this exeuctes the command on all the folders as i have mentioned "*" and now I need to skip
some folders (with name *_Shared) in the above command.

Please advice if i can use a IF loop to perform the same and how do i do. or suggest if there are any simple way to perform

See More: IF Loop in FOR Loop - Batch script

Report •

July 10, 2012 at 18:45:50
✔ Best Answer
set local & enabledelayedexpansion
set cmand=whatever
for %%d in ("*") do (
set test=%%d
set test=!test:~-7!
if /i !test! neq _shared %cmand% %%d
not tested

Report •
Related Solutions

Ask Question