I am using dir /B /A:D /O-D /TC
to get the list of Directories. I need the first result returned by this result.
I tried looping and setting the first one, but I dont know how to break out of the loop after taking the top result. Please help.
@echo off
FOR /F "tokens=*" %%G in ('dir /B /A:D /O-D /TC') DO (set latest=%%G)
echo %latest%