1

forfiles is not recognizing the + sign for the /d parameter, and i can't see why, please help?

Here's my command, i've attached a screenshot showing the files within the folder the command is being ran, the multiple ways i've attempted to get it to work, and i'm showing how it works for the - sign no problem.

forfiles /p E:\Test /m *.* /d +7 /c "cmd /c echo @file"

Goal: I'm trying to utilize forfiles to recognize files only from the last 7 days, then i want to run a 7zip on the files that were found. I just need forfiles to work!

ERROR: No files found with the specified search criteria.

  • 1
    With the `forfile` syntax, `/d +7` means "created in seven days from now or later)" (aka "next week"). (I agree - very strange idea...) – Stephan Oct 03 '19 at 17:34
  • 2
    To get the files from the last seven days, you need "created on or later", like `/d +26.09.2019` (this is a German date format and I'm using a German Windows, so I guess it's language dependent). Sadly, this forces you to do some date-math. – Stephan Oct 03 '19 at 17:41
  • Thank you both for such quick responses! Both of your combined insight is clarifying what i need to do next. i'll give an update later today! – Zachary Isom Oct 03 '19 at 17:44

0 Answers0