Last active
August 1, 2016 09:55
-
-
Save musantro/c6c0215e3c32ef701ee42301b7c87824 to your computer and use it in GitHub Desktop.
This script deletes all files and folders older than 15 days fron an specific destination folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: set folder path | |
set dump_path=E:\musan\Downloads\Contenedor | |
:: set min age of files and folders to delete | |
set max_days=15 | |
:: remove files from %dump_path% | |
forfiles -p %dump_path% -m *.* -d -%max_days% -c "cmd /c del /q @path" | |
:: remove sub directories from %dump_path% | |
forfiles -p %dump_path% -d -%max_days% -c "cmd /c IF @isdir == TRUE rd /S /Q @path" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment