@echo off
::favbackup.bat
::Backs up Favorites to the H:\ drive

If %OS%'==Windows_NT' GOTO WINNT
If Not %1'==/?' GOTO WIN9X

:WINNT
mkdir "H:\Favorites"
xcopy "%userprofile%\Favorites\*.*" "H:\Favorites" /E /H /R /Y /I /K /D
EXIT

:WIN9X
mkdir "H:\Favorites"
xcopy "C:\Windows\Favorites\*.*" "H:\Favorites" /E /H /R /Y /I /K /D
EXIT

:: Xcopy switches:
:: /E Copies everything, directories, empty directories, subdirectories...
:: /V verifies each new file
:: /H Copies hidden and system files
:: /R Overwrites read only files
:: /Y Suppresses prompting to confirm overwriting
:: /I Assume destination is a directory.
:: /K Copies file attributes
:: /D Copies only files that are newer than destinations
:: /G Allows copying of encrypted files (does not exist in Win2k/Win98)

:: DIR /X Show filenames in 8.3 format

:: Xcopy Exit code Description
:: 0 Files were copied without error.
:: 1 No files were found to copy.
:: 2 The user pressed CTRL+C to terminate xcopy.
:: 4 Initialization error occurred. Not enough memory or disk space, or invalid drive name or invalid syntax.
:: 5 Disk write error occurred.

:: Original concept by Ben. Batch file by Eric M. Bouse 2003.
:: Tested on Win2k, Win98