batch file question

I need to have two drives with the exact same files on them.  Is there a way that a simple batch file can be written so that new files on one drive will be copied to another on a daily basis?

Who is Participating?
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.

Use the xcopy command...

xcopy d:\*.* e:\*.* /s

there are also options to make sure the command will copy
empty subdirectories , etc....

type xcopy /? at your command prompt for a full listing of options.

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
patrickm3Author Commented:
I was hoping to write a txt file listing all files to be copied then converting it to a .bat and running it at a set time.  Can you suggest how to do that?

If you are running windows 98, you can schedule the batch file, in the scheduler, of course.

To get a list of files,

go to the root directory you want to start at, then type

dir /b/s > mybatch.bat

this will write the files, including path, to the bat file. Then all you have to
do is edit the batch file to create copy statements.
In addition, on to the original answer I gave you,  the xcopy command has a "D" option that will cause it to only copy the files with a newer timestamp on the source drive to the target drive.
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

From novice to tech pro — start learning today.