|Im not ... if i put after the ")" its the same even if there is no else ... the same error is there .... but we can put this behind because i found the solution|
If i want to remain 3 newer folders and the rest of them to delete the solution is this ...
for /f %%a in ('dir /b /ad ^| find /c /v "" ') do set count=%%a
if %count% geq 3 (
for /f "skip=3 delims=*" %%i in ( 'dir /b /ad /o-d ') do (@echo %%i >> zapis.txt) )
for /f "usebackq delims=*" %%t in (zapis.txt) do rmdir /Q /S %%t
firs sort them by date but not oldest first and skip the 3 new one ... the rest of them write them in zapisi.txt and then delete the names in txt file ...
TNX AGAIN FOR RESPOND