I used this method to delete older files in forfiles /p "\\oradb-serv\DB_Backup\backup" /m *.dmp /c "cmd /c del @path" /d -3but it is not working
After looking over your ForFiles command to remove a file using the command prompt, it appears you are using the right set of instructions.
However, try arranging your command as mentioned below:
ForFiles options breakdown
The options used with the ForFiles command in this reference are described as follows:
/p — indicates the pathname to start searching.
/s — instructs ForFiles to search inside subdirectories.
/d — specifies the last modified date for a file.
/c — instructs ForFiles to execute command, which needs to be wrapped in double-quotes, the default is “cmd /c del @file”.
/q — allows to delete folders without requiring confirmation.