0

I am trying to delete files from a 2008 Windows Server that are older than 180 days based on the last modified date. I am using ForFiles in order to attempt to do this. When I run the command interactively as domain admin on the server, the command executes. When I setup a task within Windows task scheduler, the task fails to run with a return code of 1.

The below command is the command I am running.

forfiles /p "E:" /s /m *.* /D -180 /c "cmd /c del @path && echo"

I have also tried the below:

enter image description here

user2216791
  • 49
  • 2
  • 11
  • I have already seen the question: http://stackoverflow.com/questions/5085116/windows-2008-server-task-scheduler-does-not-run-bat-batch-job?rq=1 This solution did not work for me either. I already have the latest patches. – user2216791 Apr 11 '14 at 14:06
  • 3
    Return code 1 just means it didn't find any files. Which could be correct – Mick Mar 18 '15 at 23:15

0 Answers0