Frontendplace Blog

Sharing Frontend developing ideas

bat backup

Posted by info on November 7th, 2006

Example creating backupfolder with date postfix in .bat file

see .bat commands: http://www.nukesoft.co.uk/msdos/categories.php

———————————————————-
@echo off
:: variables

set source=”.\sourcefoldername”
set target=”backupfoldername”
set prefix=”folderprefix”
set date=%date:~9,4%-%date:~6,2%-%date:~3,2%
set backupcmd=xcopy /s /c /d /e /i /r /k /y

echo ### Backing up directory…
%backupcmd% %sourcefolder% “%target%\%prefix%%date%”

echo Backup Complete!
@pause

—————————————————————