Оставить только 5 файлов, всё остальное удалить:
::== keep5.bat
@echo off
setLocal EnableDelayedExpansion
for /f "tokens=* delims=" %%A in ('dir backup* /b/a-d/o-d') do (
set /a kept+=1
echo !kept!
if !kept! geq 5 call :sub1 %%A
)
goto :eof
:sub1
rem echo del "%*"
del "%*"
goto :eof
:: DONE
Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Monitor de LCD, I hope you enjoy. The address is http://monitor-de-lcd.blogspot.com. A hug.
ОтветитьУдалить