I have a directory that is set up as \server\\year\month\day\x, .../y and .../z. I need a batch file that will delete videos located in the x folder in each user's directory for each month day and year based on a retention period (IE 60 days). Then delete the files in Y based on a different period (IE 730 days)
I have forfiles -p "\\server\username\year\month\day\x" -s -m *.* -d -60 -c "cmd /c del @path" but I am not sure how to do the loop in the path to search all of the sub directories from the network folder to find only the X folders.
Is there a way to do this without using the created on date attribute, just in case the camera's date/time was incorrect when the video was taken. Thanks in advance for the help! (If anyone knows a syntax that I could research I would greatly appreciate it)
forfiles -p "\\server\username\year\month\day\x\" -s -m *.* -d -60 -c "cmd /c del @path"but I am not sure how to do the loop in the path to search all of the sub directories from the network folder to find all of the X folders. Sorry for the vague question, i was hoping for a suggestion on the syntex that I could research further. – Justin Oct 22 '15 at 18:21for /F "delims=" %G in ('dir /b /s /a:D "\\server\username\x"') do @echo forfiles /P "%~G" ...and while debugged removeecho– JosefZ Oct 24 '15 at 11:04