-
Notifications
You must be signed in to change notification settings - Fork 0
/
projectbackup.cmd
33 lines (25 loc) · 932 Bytes
/
projectbackup.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@REM Create ziparchive using 7-Zip
@REM Usage: projectbackup.cmd [pathtobackup] [pathtozip] [archivename] [includepattern] [excludeswitches]
@ECHO OFF
SET _cdpath=%1
SET _zipcmd=%2
SET _archive=%3
SET _include=%~4
SET _exclude=%~5
IF "%~5"=="" GOTO createarchive
SET "_exclude=%_exclude:""="%"
:createarchive
cd /D %_cdpath%
IF %ERRORLEVEL% NEQ 0 GOTO pathnotfound
%~dps0SnoreToastGui.exe -t "WebBuilder Project Backup" -m "Starting backup task" -p "%~dps0WeBuilder.png"
start "ProjectBackup" /D %_cdpath% /low /b /w %_zipcmd% a %_archive% -spf %_include% %_exclude%
IF %ERRORLEVEL% NEQ 0 GOTO error
SET _message=Backup archive created sucessfully
GOTO done
:error
SET _message=Error creating backup archive
GOTO done
:pathnotfound
SET _message=Error: Project path \"%_cdpath%\" not found
:done
%~dps0SnoreToastGui.exe -t "WebBuilder Project Backup" -m "%_message%" -p "%~dps0WeBuilder.png"