TechGenix and SolarWinds have partnered to provide a fully-functional, free 21-day trial version of SolarWinds ipMonitor, the WindowsNetworking.com Readers' Choice Award Winner for monitoring applications, servers, and network devices to all visitors who join Security Forums. Sign up to Security Forums and get your copy today! Existing members can pick up a copy from the Members Area.
Posted: Thu May 15, 2008 8:39 pm Post subject: Delete all files/drectories older than 30 Days from a folder
I am using the forfiles.exe version:5.2.3790.0 (srv03_rtm.030324-2048) in windowsXP.
I tested the following command in batch file
-------------------------------------------------
Quote:
@ECHO OFF
ECHO ******www.moshiur.com***********
forfiles /p C:\test22\test2\ /s /m *.* /d -30 /c "cmd /c del echo @FILE"
EXIT
-------------------------------------------------
I found that it was working fine including all files in sub directories in my given path but thing is that it couldn't delete any subdirectories from this path C:\test22\test2\ . Do you have any advice ?
Posted: Sat Jul 26, 2008 7:50 am Post subject: Delete all files/drectories older than 30 Days from a folder
Quote:
try cmd line rd ot uppercase S.
Hi delcom5 ! I think you didn't understand what i was trying to do. Let me understand you 1st.
If any files age is more than 30 days , I want to delete automatically those files from the particular folder after 30 days. I need that type of command in script so that I can create a batch file for schedule
I found after research that Forfiles.exe is the best solution for that. Command line rd is able to delete all in directories /subdirectories but does not suitable for my requirements.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum