Link to home
Start Free TrialLog in
Avatar of Samoin
Samoin

asked on

MS Dos Command to Copy

Hi Experts,

I'm trying to using ms dos to copy files between two given dates, is there a specific command for that? I already tried using /D with xcopy but it copies files changed on or after the specified date. Any help will be greatly appreciated.

Thanks
Avatar of Dan Muzrall
Dan Muzrall
Flag of United States of America image

Use robocopy as it supports a minage and maxage flag:
robocopy c:\source c:\destination *.* /MAXAGE:20101231 /MINAGE:20111001
Avatar of Bill Prew
Bill Prew

Agreed there is no baseline DOS command to do the date range copy you seek.  ROBOCOPY is a good alternative, which is a free addon utility Microsoft create a while back and made available through windows resource kits.  It is now included as part of Windows 7 also.  But depending on your Windows version you may have to download and install it.

Since you will need to run something other than just DOS commands to do this, another approach would be a rather small vbscript that could do the date range checking and copy the matching files easily.  Let me know if you are interested in seeing a sample of that approach.

~bp
Avatar of Samoin

ASKER

@billprew

Can you please forward me the sample script.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks much, glad that helped.

~bp