|I am working on a batch file to archive files older than a number of days. I'm using the ForFiles command to handle the move/delete operation. I need to add something that will tell me if there are files (and how many) that meet my criteria before actually doing anything to them. I've tried a ForFiles statement for that piece as well, but it's not working. Here's the code...|
::Count files to be archived
ForFiles /D -%KeepDays% /P C:\EDI\Logs /C "Cmd /c Set /a Count=+1"
Echo FTP log files to be archived = %Count%
The %Count% variable is never incremented. What's up with that?? Is there a better/different way to accomplishe the same thing?