@echo off
echo Auto Backup minutesFiles... Starting Backup Program~
set filename=%date%%time%
echo Current time: %filename%

set outputFilename=%filename:/=-%
set outputFilename=%outputFilename::=-%
set outputFilename=%outputFilename: =_%

echo Output file will be named as %outputFilename% .zip

set originalPath=.\minutesFiles
set redundancyZipPath=.\minutesFiles\會議記錄壓縮檔\

@REM To solve path Error: after copy this file to the target computer, create new txt file then open with notepad++, change encode to ANSI code when file is empty,  then Copy & Paste all contents in this file to the new file, finally rename file from .txt to .bat & enjoy~

echo Removing download compressed cache files...
rmdir /s/q %redundancyZipPath%
mkdir %redundancyZipPath%

set bakFolder=.\Backups_MinutesFiles\

if exist %bakFolder% (
	echo Backup folder already exist! Automatic continue...
) else (
	echo Backup folder not found. Creating backup folder...
	mkdir %bakFolder%
)

echo Compressing files... Please be patient...
set compressTool="C:\Program Files\7-Zip\7z.exe"
%compressTool% a %bakFolder%%outputFilename%.zip %originalPath%
