Backup Script Files

Status
Not open for further replies.

cyclones

In Runtime
Messages
483
Location
USA
Hello. Im trying to make 3 different set's of Backup Scripts. One for Windows XP Machine, One for Vista, and One of Windows 7 machine. I work as a I.T. Support and Communications Specialist at my job, and our backup script consists of this:

Code:
-------------------------------------------------------------------------------------------
xcopy /e /i /r /y c:\"documents and settings"\%username%\"My Documents"\*.* %homeshare%\"Backup"\"My Documents"\
xcopy /e /i /r /y c:\"documents and settings"\%username%\"Favorites"\*.* %homeshare%\"Backup"\"Favorites"\
xcopy /e /i /r /y c:\"documents and settings"\%username%\"Desktop"\*.* %homeshare%\"Backup"\"Desktop"\
xcopy /e /i /r /y c:\"documents and settings"\%username%\"Application Data"\"Microsoft"\"Signatures"\*.* %homeshare%\"Backup"\"Signatures"\
xcopy /e /i /r /y c:\"documents and settings"\%username%\"application data\microsoft\outlook"\*.pst %homeshare%\"Backup"\"PST"\
xcopy /e /i /r /y c:\"documents and settings"\%username%\"application data\microsoft\outlook"\*.NK2 %homeshare%\"Backup"\"NK2"\
xcopy /e /i /r /y c:\"documents and settings"\%username%\"local settings\application data\microsoft\outlook"\*.pst %homeshare%\"Backup"\"My Documents"\"PST"\
rem rd /s /Q %homeshare%\"Backup"\"My Documents"\"My Pictures"
rem rd /s /Q %homeshare%\"Backup"\"My Documents"\"My Music"
rem rd /s /Q %homeshare%\"Backup"\"My Documents"\"My Videos"

echo Backup Complete!
    @pause
---------------------------------------------------------------------------------------
Each employee has a network drive, called their H drive.. basically where this backup script collects the files and then dumps it into a folder called Backup on their H drive. I want to modify this script so that I can back it up to an External Hard Drive, but Im not sure what to change. Also, we have a script called Restore.bat which basically copy's the files back into their directories. Here is the restore script we use at work ::
----------------------------------------------------------------------------------------
xcopy /e /i /r /y %homeshare%\"Backup"\"My Documents"\*.* c:\"documents and settings"\%username%\"My Documents"\
xcopy /e /i /r /y %homeshare%\"Backup"\"Favorites"\*.* c:\"documents and settings"\%username%\"Favorites"\
xcopy /e /i /r /y %homeshare%\"Backup"\"Desktop"\*.* c:\"documents and settings"\%username%\"Desktop"\
xcopy /e /i /r /y %homeshare%\"Backup"\"Signatures"\*.* c:\"documents and settings"\%username%\"Application Data"\"Microsoft"\"Signatures"\
xcopy /e /i /r /y %homeshare%\"Backup"\"NK2"\*.* c:\"documents and settings"\%username%\"Application Data"\"Microsoft"\"outlook"\
-----------------------------------------------------------------------------------------

Again, I want to modify the script so that it can backup to a external hard drive.

Can anyone help me?? I want to make three different sets of these, since Xp to Vista to Windows 7 have different locations for Documents/Pictures and etc.

Thanks!!
 
find and replace to change the destination location

open in notepad. click edit > replace. enter %homeshare% in find what. enter the path to the external drive in replace. click replace all
 
Status
Not open for further replies.
Back
Top Bottom