Batch file to copy paste

I need a batch file which will copy files which the modified date is not the current date from a folder A and paste it in folder B.

And

to delete files from folder B which is older than five days (from top)

And i need to schedule it in windows scheduler to run this at 15:00 . If the today's file not arrived at 15:00 it should run at 16:00 and again its not arrived 17:00 and so on ...till 23:00...

Please help me !
jaisonshereenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kram0Commented:
"xcopy <source> <destination> /D /Y" will work to copy/overwrite files that are newer than what already exists in the destination.
As for deletion of older files, you may need to run something from vbs.
0
jaisonshereenAuthor Commented:
how to delete the file according to "modified date"?
0
kram0Commented:
This VBS looks to be pretty much exactly what you are after...
http://cwashington.netreach.net/depo/view.asp?Index=723
0
jaisonshereenAuthor Commented:
could you tell me how to execute this?

i have copy pasted the entire script as filename.vbs

is it a mater of double clicking?
0
kram0Commented:
Double-click will work. You could call it from the batch file with "wscript filename.vbs".
You could then schedule the batch file to run automatically.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.