Backup using Xcopy

Here is a line of code using xcopy followed by an explanation.

Be cautious when using it with Win2003, XP and Vista.  Permissions are extremely important.

In Vista, I would suggest that you set the Explorer folder VIEW to DETAILS and the properties to show full file names and paths.  ( In Vista, setting the properties is done in Control Panel>Folders.

___________________________________________________________

xcopy c:\users\*.* g:\users\ /e /v /c /i /f /h /r /y

explanation

[xcopy]    is the command followed by a space

[c:\users\*.*]    is the folder(s) and file(s) to be copied followed by a space

[g:\users\]    is the drive and folder as the destination followed by a space

/e    =    copies directories and subs directories, including empty ones.

/v    =    verifies each new file

/c    =    continues copying even if errors occur.

/i    =    if destination does not exist and copying more that one file, assumes that the destination must be a directory.

/f    =    displays full source and destination files names while copying.

/h    =    copies hidden and system files also.

/r    =    overwrites read-only files.

/y    =    suppresses prompting to confirm you want to overwrite an existing destination file.

 

How to use it.............................

at the command line or place this code in a batch file (.bat) or a command file (.cmd)

the file can be run from a TASK SCHEDULER also but be sure to set permissions for the administrator, which will insure that the backup will work without failing due to a stupid permissions error.

 

                    xcopy c:\user\*.* g:\users\ /e/v/c/i/f/h/r/y
                    pause   

 

The use of the word "pause" at the end of the script holds the command line screen open until you hit any key.

The xcopy command can be used for any number of lines needed in the script.