1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Use of Xcopy to backup emails

Discussion in 'DOS/Other' started by Telegraph Sam, May 3, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. Telegraph Sam

    Telegraph Sam Thread Starter

    Joined:
    Jun 12, 2009
    Messages:
    37
    1. I am trying to create a batch file using xcopy to backup stored emails, having identified where the database hides in my C: drive. To save time I want to do this on an incremental or differential (difference?) basis rather than xcopy the whole lot every time. But I find the various switches or parameters that can be used with xcopy confusing. /A and /M affect the "attributes" (??) - is one of these what you use? Or am I limited to the /D date switch which would be less flexible? Or something else? I use Windows XP Home but would do this via the DOS command prompt window.

    2. Ditto my Address Book except that I can't find where it lives. Instead I have "exported" it to a folder where I can find it / the copy. However this takes the form of just one file. I suspect that this contains just an alphabetical list of the contacts whilst I want to preserve the structure of the (sub) folders in my database. Can this be done - or do I have to take this problem to the email forum?
     
  2. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Just use /D without specifying a date. That will only copy a file if it's newer than the backup, meaning the modified date is newer.

    Xcopy /CDY should do the trick. C continues if there is an error, Y suppresses the prompt to overwrite an existing file.

    You didn't say what email program you are using, I'm guessing Outlook Express. The Address book is a .wab file (Windows Address Book) stored here:
    Code:
    C:\Documents and Settings\<user name>\Application Data\Microsoft\Address Book
    
     
  3. Telegraph Sam

    Telegraph Sam Thread Starter

    Joined:
    Jun 12, 2009
    Messages:
    37
    Thanks for helpful reply. You are correct, I forgot to say that I'm using OE.
    I'll try the switches you suggested [can you run them together without repeating the /'s?]
    Whilst on the subject what does the "archive" switch do / not do?

    I couldn't find the Address Book where you thought it might be but I've got the exported version stored somewhere else. But I suspect without the directory structure which I am trying to preserve.
     
  4. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    With Xcopy, you can run the switches together.

    The Archive flag is set on a file when it is created or modified. Backup programs (if using the archive flag to determine what to backup) should unset the flag when they do a full or incremental backup. The next time the backup is run, if the flag has not been set, the file has not been changed, so it can be skipped.

    If you want to copy files to two locations for redundancy, that can be a problem; if the first backup unsets the flag, the second one sees nothing to copy. So some programs can be configured to not unset the Archive flag. If the last backup to run doesn't unset it however, it becomes useless for determining which files need to be backed up.

    Xcopy by itself does not change the Archive flag, and ignores it for determining what to copy. With no switches, it copies everything except hidden and system files.
    Using /A, it will only copy files with the Archive flag set, but does not unset it. This allows you to run it again to copy to a different location.
    Using /M, it will copy files with the Archive flag set, then unsets it to indicate the file has been backed up.
    In neither case will it copy hidden and system files unless the /H switch is used.

    For the address book, make sure you are looking in Application Data\Microsoft and not Local Settings\Application Data\Microsoft
    Also, the Application Data\Microsoft folder usually has the System flag set, so if you don't have your view settings set to show System files, you won't see the folder. It's not the same setting as for Hidden files and folders.

    To change View Settings to show hidden and system files:
    In Windows Explorer, click on Tools | Folder Options -> View tab
    Check the following:

    • Display the contents of system folders
    • Show hidden files and folders
    Uncheck the following:

    • Hide extensions for known file types
    • Hide protected operating system files (Recommended)
    You can also search the drive for *.wab files, but be sure to enable searching hidden and system folders
     
  5. Telegraph Sam

    Telegraph Sam Thread Starter

    Joined:
    Jun 12, 2009
    Messages:
    37
    Sorry I did not acknowledge your helpful explicit reply earlier. I "lost" the thread ...

    I will get around to xcopying /CDY on my office PC sooner or later as you suggest including searching for the address book with system files revealed. I suspect I could achieve the same effect with "archives" but at the risk of greater complications if things go wrong.
     
  6. Telegraph Sam

    Telegraph Sam Thread Starter

    Joined:
    Jun 12, 2009
    Messages:
    37
     
  7. Telegraph Sam

    Telegraph Sam Thread Starter

    Joined:
    Jun 12, 2009
    Messages:
    37
    I thought I would be really clever and include my IE favo(u)rites in my batch driven backup routine in case of melt-down. But I can't figure out where the file hides on my C: drive. I know that you can export the file from IE to wherever you want but I want to copy the original by default. Is there a bookmark or something file lodged somewhere in Windows XP when you use IE 8?
     
  8. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    C:\Documents and Settings\%username%\Favorites
     
  9. Telegraph Sam

    Telegraph Sam Thread Starter

    Joined:
    Jun 12, 2009
    Messages:
    37
    Tks 4 instant reply. I wish all queries were as quick and easy to resolve!
     
  10. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,786
    Was a quick easy Google search. I couldn't remember myself because I have been using FireFox for the last 4 years.
     
  11. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Use "%UserProfile%\Favorites" and it works on Vista and Win7 Too
     
  12. Telegraph Sam

    Telegraph Sam Thread Starter

    Joined:
    Jun 12, 2009
    Messages:
    37
    Appetite whettened I decided to create batch files to back up selected other directories also. One of these contains programs that I have downloaded. Can you identify why..

    c:
    xcopy "C:\Program Files\*.*" H:\Iain\Backups\Programs\*.* /C /D /Y /E /F /W /EXCLUDE:"c:\Program Files\excludelist.txt"

    only produces the result that DOS doesn't recognize the file "c:\Program Files\excludelist.txt"? I have experimented with different variations including removing the quotes without success. The exclude list.txt contains only \Goldmine\ which is the folder which I want to exclude.

    At one point I got the program (without the exclude switch) to start copying but it seemed to stop after doing just one folder.

    The wonderful world of DOS.
     
  13. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    What program did you use to create the excludelist.txt file? It may have been saved as Unicode, which won't work.
    Open the file in Notepad
    Click File | Save As, and see if the Encoding: box is set to something other than ANSI
     
  14. Telegraph Sam

    Telegraph Sam Thread Starter

    Joined:
    Jun 12, 2009
    Messages:
    37
    Unfortunately I can't get back to the office PC to check until next week but I wrote and saved both the bat and txt files in Notepad default. I put a pause in the batch file to see what happens and it looks as if it is tripping up on the path and name of the text file and not the contents or format.
     
  15. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Totally forgot about this one little bug with Xcopy, which still hasn't been fixed, even in Win 7
    You can't use quotes around the exclude file name, so you have to use the short name for any paths with spaces, or put the file in a location with no spaces in the path:
    /EXCLUDE:C:\PROGRA~1\excludelist.txt

    If you keep the exclude file in the same folder as the batch file, or better yet, create it from the batch file when it is run, you can use this to specify the file name:
    /EXCLUDE:%~dps0excludelist.txt
    %~dps0 uses Drive, Path, Shortname of the batch file location (%0) without quotes (~).
    Create the file with this:
    >%~dps0excludelist.txt Echo.\Goldmine\
    >>%~dps0excludelist.txt Echo.\Another\

    And delete it when done.


    You may want to include the /H switch, there are a few files in the Program FIles tree that are hidden and/or system. Without /H, they will not be copied.
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/920764

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice