如何使用高级查询语法 (AQS) 在 Windows 上查找早于 x 天的文件?

phi*_*ilk 6 windows search windows-explorer

您可以使用以下命令查找早于本周的文件

datemodified:< this week
Run Code Online (Sandbox Code Playgroud)

datemodified:< 7 days
Run Code Online (Sandbox Code Playgroud)

似乎不起作用。

Dav*_*ill 8

如何在 Windows 上查找超过 x 天的文件

datemodified:< 7 days
Run Code Online (Sandbox Code Playgroud)

似乎不起作用。

当使用<或引用相对日期“值”时,>该值不能是与日期相关的任何关键字值(如下所列)。它必须是使用格式dd/mm/yy(或“区域和语言”设置中指定的任何格式)的值。

要查找早于x几天的文件,请使用以下命令:

datemodified:< dd/mm/yy
Run Code Online (Sandbox Code Playgroud)

这里dd/mm/yyx目前(今天的)日期的前几天。

笔记:

  • 输入日期时,请使用与“控制面板”>“区域和语言”设置相匹配的日期格式。

  • 有一个例外,年份应始终输入为 4 位数字。


使用过滤器搜索

以下是受支持的日期相关过滤器的示例

Criteria                                Syntax/Example
Date created (exact date)               datecreated:8/2/2012
Date created (range)                    datecreated:8/2/2012..8/3/2012
Date created (before)                   datecreated:<8/2/2012
Date created (after)                    datecreated:>8/2/2012
Date created prior to the current year  datecreated:a long time ago
Date created within the current year    datecreated:earlier this year
Date created within the current month   datecreated:earlier this month
Date created within the current week    datecreated:earlier this week
Date created yesterday                  datecreated:yesterday
Date created today                      datecreated:today
Date modified (exact date)              datemodified:8/2/2012
Date modified (range)                   datemodified:8/2/2012..8/3/2012
Date modified (before)                  datemodified:<8/2/2012
Date modified (after)                   datemodified:>8/2/2012
Date modified prior to the current year datemodified:a long time ago
Date modified within the current year   datemodified:earlier this year
Date modified within the current month  datemodified:earlier this month
Date modified within the current week   datemodified:earlier this week
Date modified yesterday                 datemodified:yesterday
Date modified today                     datemodified:today
Run Code Online (Sandbox Code Playgroud)

Windows 7 搜索解释


与日期相关的关键字值

引用日期时,用户可以使用以下关键字。

相对日期:今天、明天、昨天

多字相对日期:周、下个月、上周、上个月或来年。

还可以按以下方式输入这些值:thisweek、nextmonth、lastweek、lastmonth、comingyear。

天数:周日、周一...周六

月份:一月、二月...十二月

使用高级查询语法在 Windows 7 中查找文件的源代码


进一步阅读