Guest User

Untitled

a guest
Mar 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. @ECHO OFF
  2. SETLOCAL
  3. SET "targetdir=C:source"
  4. SET /a retain=3
  5.  
  6. FOR /f "skip=%retain%delims=" %%a IN (
  7. 'dir /b /a-d /o-d "%targetdir%*" '
  8. ) DO DEL (DEL "%targetdir%%%a"
  9.  
  10. GOTO :EOF
Add Comment
Please, Sign In to add comment