|> So I created the below code to grab the YEAR of |
> a file from the DATE MODIFIED and if it is NOT
> EQUAL to 2010, then move all the files in that DIR
> by creating a second .BAT. However, I have MANY
> sub-dirs, with MORE files, how can I have it go
> through ALL sub-dirs without having to code the sub
> dir each time.
I would check out ROBOCOPY (MS software) or XXCOPY (3rd party stuff) and check out if any date related parameter (and ROBCOPY has got a huuuuuuuge amount of them) does what you ask ... instead of re-inventing the wheel.
Edit : there you go, got it working with XXCOPY :
xxcopy *.* D:\temp /DB:2009-12-31 /S
Copies all files in current dir, where last mod. time is last day of 2009 or earlier, and with files to be beholded in subdirs (creating dirs where needed)
The ROBOCOPY version also has mentioning of date, but only with "last access time" ... not what you want.
edit : you may need this, to perform a MOVE instead of copy :
xxcopy *.* D:\temp /DB:2009-12-31 /S /RC
(be CAREFUL as this command can be dangerous)