:: 上面这句为判断%destination%中是否存在引号,有则剔除
if "%destination%"==":" goto input_destination
if "%destination%"=="0" exit
if "%destination%"=="1" goto input_source
if "%destination%"=="9" goto freesize
:: 下面一句针对文件或文件夹取保存位置的文件名
for /d %%i in ("%source%.*") do set destination=%destination%%%~nxi
for %%i in ("%destination%") do set destination=%%~fi
set subarea=%destination:~0,1%
for %%i in ("%destination%") do if "%%~fi"=="%%~di" goto forbid_to_build_1
echo "%destination%" | findstr /i /c:"%source%" && goto forbid_to_build_2
if not exist %subarea%:nul goto subarea_noexist
:: 下面一句取日志名为要备份文件(夹)的文件名
for %%i in ("%source%") do set name_log=%%~ni
if exist "%destination%%name_log%_log.log" goto whether_add
if exist "%destination%" goto whether_over
:over_write
attrib /s /d -s -h -r "%destination%*.*">nul 2>nul
rd /q /s "%destination%">nul 2>nul
md "%destination%">nul 2>nul
(echo.
echo 备份日志)>"%destination%%name_log%_log.log"
attrib /s /d +s +r "%destination%*.*">nul 2>nul
:input_date
cls
color 1f
title 文件备份器-请输备份入日期
echo ╭────────╮
echo ╭─────────┤ 请输入备份日期 ├─────────╮
echo │ ╰────────╯ │
echo │ │









