Deleting files older than 30 days from network location

G

Gaurav Kumar_GK

Hi Everyone.I am trying to delete files older than 30 days from a network location by using below script using in task scheduler.PushD "\\10.0.0.141\CNC-Files\test\Backup" &&(forfiles /d -30 /c "cmd /c del /q @file")& PopDand it is working perfectly as desired. Now when I replace '@file' with '*.csv' to delete only .csv files older than 30 days.it is deleting all the csv files regardless of the number of days.PushD "\\10.0.0.141\CNC-Files\test\Backup" &&(forfiles /d -30 /c "cmd /c del /q *.csv")& PopDAny suggestion on how to correct this so that this will delete csv fil

Continue reading...
 
Back
Top Bottom