Hi
We have an FTP server with users with multiple folders. The requirement is that users delete the old files after a week,
I am looking at doing this automatically,
Does anyone know if this can be done is power shell or a batch script, that will go to a folder or sub folders, look for files older than a week and delete them
Thanks
V
You need to modify the line 2 to specify the top level folder.
==========================
@echo off
set topLevel=d:\some\directory
cd /D %topLevel%
FOR /D %%a IN (*) DO (
forfiles /P "%topLevel%\%%a" /S /M *.* /D -7 /C "cmd /C del @PATH"
cd /D %topLevel%\%%a
for /f "delims=" %%i in ('dir /s /b /ad ^| sort /r') do rd "%%i">NUL
)
==========================