While backing up a machines C drive what are the folders that need to be backed up.

Posted on 2007-07-27
Last Modified: 2012-05-05

While backing up a machines C drive what are the folders that need to be backed up.
Favorites,Desktop,NK2 files,pst what else.
So i need a script which will back all these up on one click to the same or remote machines folder.

Question by:bsharath
    LVL 32

    Accepted Solution

    I would suggest that instead of trying to see what folders need to be backed, you should make a list of what should _not_ be backed up.

    Here is the simple script I use:

    xcopy c:\*.* /s/e z:\ /c/f/h/d/y/o /EXCLUDE:exclude.txt

    This backs up the entire c: drive to the z: drive (which could be a mapped network drive), except for files/folders specified in the file "exclude.txt"

    At present I have the following items in the exclude.txt file. You can add or subtract of course:

    \Temporary Internet Files\
    \System Volume Information\
    \Program Files\

    (Items in \...\ are folder names, the rest can be files or folders)

    Here is am explanation of the flags used with xcopy:

    Rem       /s  means all subdirectories also
    Rem       /e  means empty folders also
    Rem       /c  means ignore errors
    Rem       /f  means full display in console window
    Rem       /h  means hidden files also copied
    Rem       /d  means copy only those files that have changed
    Rem       /y  means do not prompt for overwriting existing files
    Rem       /o  means retain file ownership and acl info

    Note that only files that have chamged since the previous backup are copied the next time (due to the /d flag)

    You can create two small files, one called (e.g.) backup.bat in which you put the xcopy command, and the other exclude.txt. Then you can do the backup whenever you want by double-clicking on the backup.bat file, or even schedule it for automatic backups every night.

    And be sure to test things are working before trusting any backup scheme.

    LVL 12

    Expert Comment

    One could argue, that for a simple desktop you just need to backup C:\Documents and Settings, since most apps need to be reinstalled anyway, and in the event of a disaster recovery you will likely be doing a format reinstall.
    LVL 32

    Expert Comment

    "that for a simple desktop you just need to backup C:\Documents and Settings"

    True, but over time I discovered that many people end up creating data and document folders in all sorts of new places outside the "documents and settings" tree. In most cases this is impossible to predict in advance, hence my suggestion to back up everything but the obvious folders such as "Windows" and "Program Files"

    Just to be sure, my suggestion is for XP, folder names are different for Vista, or 2000.
    LVL 70

    Expert Comment

    One problem in using XCOPY (or ROBOCOPY for that matter) is that it will not copy open files. You would be better off running WIndows Backup on the local machine, that will copy open files and you can also include the system state.
    LVL 32

    Expert Comment

    Yes, good point about open files. If using xcopy it is good to close other open applications. I like and use NTbackup, however for convenience and ease of use and recovery it is hard to beat xcopy. It just sounds more like what the asker had in mind, but NTbackup should definitely be considered.
    LVL 32

    Expert Comment

    Thanks and good luck.

    Featured Post

    Free book by J.Peter Bruzzese, Microsoft MVP

    Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

    Join & Write a Comment

    My previous article  ( one possible method to get SCCM 2007 installed an…
    Some time ago I faced the need to use a uniform folder structure that spanned across numerous sites of an enterprise to be used as a common repository for the Software packages of the Configuration Manager 2007 infrastructure. Because the procedu…
    This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
    In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now