I'm trying to create a batch script which deletes the files and the folders older than 2 weeks.
This is the script i'm using, but this dosent work as expected .
Forfiles /P C:\TEST1\log_output /S /M *.* /D -14 /C "cmd /C del @path" >"C:\TEST1\TEST1.log" 2>&1
Forfiles /p C:\TEST1\log_output -D -14 -C "CMD /C IF @ISDIR==TRUE ECHO rd /d /s @filE&rd /q /s @filE"
can someone help me on this, I'm new to scripting and fresher.