If you want to simply specify subdirectories of the current directory:
dir /ad /b
If you are in a different directory, you can simply do:
dir c:\temp /ad /b
/admeans a list of all elements with the attribute "catalog", and /b- this is a bare format
Update:
, , dir cmd . , , , "". , (/on) MY_ENV_VAR :
for /f "delims=" %%a in ('dir "c:\temp" /on /ad /b') do @set MY_ENV_VAR=%%a
, script , PowerShell, .
Get-ChildItem | where {$_.PSIsContainer}
, .