Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a batch script to copy a directory with files in it

xcopy "C:\Test" "D:\Test" /D/E/C/R/I/K/Y

But I neet the script which would copy only those files older than specified date&time1 and newer than specified date&time2. for example, there should be file created between 10.00 am 12.01.2012 and 2.00 pm 13.01.2012. The directory structure should remain the same as the original one. The script should work under Windows Server 2003.

share|improve this question
It give me pains to think about coding that in a .bat (if it can be done). I'd go Perl (or mingw/cygwin). Anyway, I wonder if this question should be migrated to SO – leonbloy May 7 '12 at 2:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.