I've been working with this script to help achieve my goal, which is deleting files and folders, but I'm a little confused as to how I can add a time length to it. I would like to delete files and folders after 2 weeks, any suggestions?
set folder="C:\test"
cd /d %folder%
for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)
I've built off this post (Batch file. Delete all files and folders in a directory) but am unable to comment as my reputation doesn't allow it. Thanks again