Windows Vista cmd FORFILES illogical date selection?

Joined
Nov 9, 2008
Messages
2
Reaction score
0
I'm a bit baffled by a change in logic of the FORFILES cmd introduced when I upgraded to Vista.

The date switch (/D) used to allow me to select files that had been modified in the past N days, but now it appears that this is no longer a simple (or perhaps even possible) to accomplish.

In the older version, I could select all the files that were 3 or fewer days old with:

FORFILES /D 3

Now, according to the help text (below), this command selects files with a modified date 3 or more days IN THE FUTURE. (Neat trick).

Two questions:
1. Am I interpreting the logic correct?
2. Any idea how to select recent files?

/D date Selects files with a last modified date greater
than or equal to (+), or less than or equal to
(-), the specified date using the
"MM/dd/yyyy" format; or selects files with a
last modified date greater than or equal to (+)
the current date plus "dd" days
,
or less than or
equal to (-) the current date minus "dd" days. A
valid "dd" number of days can be any number in
the range of 0 - 32768.
"+" is taken as default sign if not specified.
 

muckshifter

I'm not weird, I'm a limited edition.
Moderator
Joined
Mar 5, 2002
Messages
25,739
Reaction score
1,204
Hmmm, my reading is you should specify ... like maybe;


FORFILES /D -3


... there again, it's a loooong time since I did any programing. CPM anyone? ;)



:user:
 
Joined
Nov 9, 2008
Messages
2
Reaction score
0
Thanks, but that returns files that are OLDER than 3 days. Just seems like someone wasn't thinking when they decided that +3 would be today PLUS 3 days or more.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top