I need to search a file on my disk modified after a given date using the command line.
For example:
dir /S /B WHERE modified date > 12/07/2013
In the File Explorer ribbon, switch to the Search tab and click the Date Modified button. You'll see a list of predefined options like Today, Last Week, Last Month, and so on. Pick any of them. The text search box changes to reflect your choice and Windows performs the search.
Click in the search box to make the Search Tools tab available on the ribbon, then click the Date modified button and choose one of the available options. That click automatically enters the Datemodified: operator in the search box.
/directory/path/ is the directory path where to look for files that have been modified. Replace it with the path of the directory where you want to look for files that have been modified in the last N days. -mtime -N is used to match files that had their data modified in the last N days.
The forfiles
command works without resorting to PowerShell. The article is here:
Find files based on modified time
Microsoft Technet documentation: forfiles
For the example above:
forfiles /P <dir> /S /D +12/07/2013
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With