# simple batch file



## rjh4th (Dec 29, 2003)

I am trying to write a batch file to automatically backup my outlook data. I havent done this before and I am sure I made a simple mistake. Here is what I have written:

xcopy /h /e /v /y C:\Documents and Settings\rudy.MURRAY\Local Settings\Application Data\Microsoft\Outlook F:\Users\Rudy\outlookbku

Any help would be appreciated.


----------



## mole (Aug 24, 1999)

Better wrap anything with a space in it in quotation marks. Such as:

xcopy /h /e /v /y "C:\Documents and Settings\rudy.MURRAY\Local Settings\Application Data\Microsoft\Outlook\*.*" F:\Users\Rudy\outlookbku

(all on one line)

If you specify the file type, that is up to you, but the *.* will cover all of them. A /c can be added for good measure as this allows a graceful recovery if something goes wrong such as the file is in use.


----------



## rjh4th (Dec 29, 2003)

That sort of worked, it pulled the archive office data file and the extend DAT file, but the outlook office data file did not get backed up. Is there some kind of size limitation that may have kept that file from being copied?


----------



## mole (Aug 24, 1999)

You have the /v switch which will verify each copy and you also have the /y switch to answer "yes". I usually use the combination:

xcopy {source}\*.* {destination}\*.* /s /e /h /c /y 

(/y isn't supported the same in NT as in 2K or XP, nor are the switches exactly the same in Win9x, but generally still apply)

This gets all files and subdirectories no matter if empty or containing files.

Make sure that you are pointing in the proper directory, mine is located down the same tree except there is an "indentities directory and another named for the CLSID in addition to what you have below "...\local settings\application data\..." . There is no size limit assuming the destination has adequate capacity. You will have to close anything locking the file as well, such as Outlook and make certain that the process is fully closed by checking the task manager and ending task on it if it is still running. Frequently Outlook will continue to run in the bkg. if the database files are large or corrupted. At login/boot-up is a good time to do things before you open applications.


----------

