title: Batch file to delete files and also create the log of deleted files
body: <p>I have this code below which use to delete files and folder from drive from the particular date.....This code works fine.
  Now i want to modify this code that....</p>
  
  <p>i want log of all the deleted files that are deleted.....
  Kindly help me to do this</p>
  
  <pre><code>@echo off 
   :: set folder path 
  
      set dump_path=E:\
  
   :: set min age of files and folders to delete 
  
      set max_days=0
  
  :: remove files from %dump_path%
  
   forfiles -p %dump_path% -m *.* -d -%max_days% -c "cmd /c del /q @path" 
  
  :: remove sub directories from %dump_path%
  
   forfiles -p %dump_path% -d -%max_days% -c "cmd /c IF @isdir == TRUE rd /S /Q @path
  </code></pre>
  
  <p>" </p>