Link to home
Start Free TrialLog in
Avatar of grjitdept
grjitdept

asked on

How to write a vbscript to copy files recently modified but keep the folder sructure as well?

Hi,

I am trying to write a vbscript that copies the contents of a folder (files and folder structure) to another folder, but ONLY where the files have been modified/created in the previous day.

I've found plenty of examples of how to copy files, folders or both, but I'm unsure how to go about selectively copying by modified date. For example, I'm fairly sure I could copy all files from a folder and subfolders into a single folder, but then I'd loose the original foldder struture... The key here is that I want to keep the folder structure of the files but only copy the recently modified ones...

Hope that makes sense!
ASKER CERTIFIED SOLUTION
Avatar of LauraEHunterMVP
LauraEHunterMVP
Flag of United States of America image

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
SOLUTION
Avatar of Brian Pierce
Brian Pierce
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of grjitdept
grjitdept

ASKER

I've just read up on xcopy and it seems that would do the trick nicely! I'm still curious if there is a simple and effective way of doing a similar thing in vbscript so I'll the question open a bit longer...
ah yes the /d switch - you could use that as well/instead - see the link i gave earlier.
SOLUTION
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
Use robocopy to Mirror

See http://www.ss64.com/nt/robocopy.html