TomGee.us

Tag: Batch

Backup PC via Batch Script

by Tom Gee on Apr.25, 2010, under Scripts

I made a few small alterations to the script found [http://www.speedguide.net/read_articles.php?id=1547] and use it on a regular basis to backup my Windows 7 PC.

The source code is as follows, where F:\Backup is the location on my external drive where I want my files to be copied to:

@echo off
:: variables
set drive=F:\Backup
set backupcmd=xcopy /s /c /d /e /h /i /r /y
echo Starting Backup – %date% %time% >> %drive%\backup.log
echo ### Backing up Documents…
echo   Documents >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Documents” “%drive%\Documents”
echo ### Backing up Pictures…
echo   Pictures >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Pictures” “%drive%\Pictures”
echo ### Backing up Desktop…
echo   Desktop >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Desktop” “%drive%\Desktop”
echo ### Backing up Downloads…
echo   Downloads >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Pictures” “%drive%\Downloads”
echo ### Backing up Favorites…
echo   Favorites >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Favorites” “%drive%\Favorites”
echo ### Backing up Music…
echo   Music >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Music” “%drive%\Music”
echo ### Backing up Videos…
echo   Videos >> %drive%\backup.log
%backupcmd% “%USERPROFILE%\Videos” “%drive%\Videos”
echo Backup Complete!
echo Backup Complete – %date% %time% >> %drive%\backup.log
Click [this link] to download the above batch script and enjoy!

1 Comment :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!