@echo off REM # To install: REM # REM # (windows 7): REM # Goto Start->Run. Type in shell:sendto REM # Save as Backup.bat REM # REM # To use: REM # right click on the folder you want to backup and click on the batch file REM # in the sendto menu. REM # REM # Example: REM # REM # If you are in this folder and run the script on Production folder a REM # backup of the folder is placed in REM # X:\App\Prod\Backups\Prod.YYYY.MM.DD.HHMI.zip REM # set year=%date:~-4,4% set month=%date:~-7,2% set day=%date:~-10,2% set hour=%time:~-11,2% set hour=%hour: =0% set min=%time:~-8,2% set zipfilename=myBackup.%year%.%month%.%day%.%hour%%min%.zip set destination=%~dp0 set source="%~1\*" set dest="%destination%Backup\%zipfilename%" set AppExePath="C:\Program Files\7-Zip\7z.exe" if not exist %AppExePath% goto notInstalled echo Backing up %source% to %dest% %AppExePath% a %dest% %source% xcopy %dest% e:\ echo %source% backed up to %dest% is complete! goto end :notInstalled echo Can not find 7-Zip, please install it from: echo http://7-zip.org/ :end PAUSE
Update your browser to view this website correctly.