# Backup batch file



## brooke (Feb 2, 2000)

I am trying to setup a batch file to be scheduled to run at night to backup some of the server files.
I have the basic file written, but how do I default it to overwrite. Right now when it starts running, it asks to overwrite and no one is here to press the 'A' button to overwrite all. How do I code that into the batch file.

Right now the batch file looks like this:
xcopy b:\*.* d:\safback\ /e
xcopy i:\*.* d:\server~1\ /e
xcopy j:\*.* d:\jukebox\ /e
xcopy x:\*.* d:\edexpr~1\ /e
xcopy t:\*.* d:\techs\ /e


----------



## zephyr (Nov 6, 2003)

This will do it for you:

echo y | xcopy b:\*.* d:\safback\ /e
echo y | xcopy i:\*.* d:\server~1\ /e
echo y | xcopy j:\*.* d:\jukebox\ /e
echo y | xcopy x:\*.* d:\edexpr~1\ /e
echo y | xcopy t:\*.* d:\techs\ /e


The | symbol is above the \ on your KB. The spaces are critical.

Best regards.


----------



## brooke (Feb 2, 2000)

GREAT!!!!!  
Thank you so much!! That worked!


----------



## zephyr (Nov 6, 2003)

Thank you for the feedback * brooke * so that others can share.

Also consider how using *echo n |* and *echo a |* might help you in some situations.

Best regards.
ps. I'm a Mt. Vernon, IL transplant.


----------

