I think FOR
/IF NOT EXIST
are your friends, in this case...
For immediate subfolders of the current folder...
for /d %A in (*) do @if not exist "%~fA\Arg\*" echo %~fA
Or recursively, from current folder down...
for /d /r %A in (*) do @if not exist "%~fA\Arg\*" echo %~fA
Or recursively, from a given path...
for /d /r X:\pathto %A in (*) do @if not exist "%~fA\Arg\*" echo %~fA
Conversely...
for /d %A in (*) do @if exist "%~fA\Arg\*" echo %~fA
for /d /r %A in (*) do @if exist "%~fA\Arg\*" echo %~fA
for /d /r X:\pathto %A in (*) do @if exist "%~fA\Arg\*" echo %~fA
In a batch file, you would need to escape the %
symbol...
for /d %%A in (*) do @if exist "%%~fA\Arg\*" echo %%~fA
for /d /r %%A in (*) do @if exist "%%~fA\Arg\*" echo %%~fA
for /d /r X:\pathto %%A in (*) do @if exist "%%~fA\Arg\*" echo %~fA
for /d %%A in (*) do @if not exist "%%~fA\Arg\*" echo %%~fA
for /d /r %%A in (*) do @if not exist "%%~fA\Arg\*" echo %%~fA
for /d /r X:\pathto %%A in (*) do @if not exist "%%~fA\Arg\*" echo %~fA
If you're doing it regularly, perhaps a macro...
doskey nosubdir=for /d %A in (*) do @if not exist "%~fA\$*\*" echo %~fA
doskey nosubdirrec=for /d /r %A in (*) do @if not exist "%~fA\$*\*" echo %~fA
...
cd /d x:\pathto
nosubdir Arg
nosubdirrec Arg
Can you do some sort of diff on the list then to find out the folders which has it and don't? – Aryat Mapreh – 2016-02-11T14:59:11.500