Skip to content

Instantly share code, notes, and snippets.

@felipefernandes
Created October 2, 2013 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipefernandes/6798335 to your computer and use it in GitHub Desktop.
Save felipefernandes/6798335 to your computer and use it in GitHub Desktop.
Batch file de backup para windows
ECHO off
set source="C:\Users\Public\Dropbox\Alunos 2013.2"
set destination="C:\Users\Public\webdesign_backup"
for /F "tokens=1-4 delims=/ " %%A in ('date/t') do (
set DateDay=%%A
set DateMonth=%%B
set DateYear=%%C
)
set CurrentDate=%DateMonth%-%DateDay%-%DateYear%
if exist %destination% goto GO
:GO
cd %destination%
mkdir %CurrentDate%
xcopy %source% %destination%\%CurrentDate% /s/d/y/c/v/r
echo.
echo ** Backup completo! **
echo.
echo Backup criado: %destination% \ %yyyymmdd1%
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment