getting a forfiles result that shows file locations

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Norma
Posts: 5
Joined: 22 May 2020 18:27

getting a forfiles result that shows file locations

#1 Post by Norma » 15 Jun 2020 19:12

I frequently generate file lists using a command like this:

dir *smith*.pdf /s /od > smithy.txt

Then, in a word processor (WP 5.1+), I trim the list to delete files before a particular date. Notwithstanding macro skills, it is tedious.

What is the syntax for getting a file list from forfiles that shows you the location of each file?

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: getting a forfiles result that shows file locations

#2 Post by Squashman » 15 Jun 2020 22:36

Code: Select all

forfiles /S /D -9/24/2007 /M *smith*.pdf /C "cmd /c echo @path"

Norma
Posts: 5
Joined: 22 May 2020 18:27

Re: getting a forfiles result that shows file locations

#3 Post by Norma » 16 Jun 2020 06:23

Thank you!

Post Reply