David Overton's Blog and Discussion Site
This site is my way to share my views and general business and IT information with you about Microsoft, IT solutions for ISVs, technologists and businesses, large and small.  

Browse by Tags

  • How to copy or archive files by year using the command line and robocopy

    I got this question via e-mail and decided I would post the answer here in a blog. (Updated 16th Feb 2017 with a typo correction) I want transfer all files created in Office Word 2003 by year (annual batchs - ex: 2005, 2006, etc.) to external HD. How can to do this? I will appreciate your answer. Edgar To do this via the command line you can use Robocopy which is present in Windows Vista and Windows 7. If you have Windows XP download the Server 2003 Resource Toolkit and install it. Robocopy will be part of the install and found in the install directory. The actual command would look like this and would need to be entered into a command prompt: for /L %x in (2009,-1,2000) do robocopy source destination \%x *.doc? /maxage:%x0101 /minage:%x1231 /s To break it down a bit.. for /L %x in (2009,-1,2000) do This creates a counter from 2009 up in steps of -1 (or down in steps of 1) until 2000 is reached. Each time the counter changes it is set into %x, so %x will become 2009, 2008 and so on. It then executes the command...

(c)David Overton 2006-18