PROE备份工具v1.3

@echo off&setlocal enabledelayedexpansion
title PROE备份工具V1.0 code by 姚子红
::ID:yaozidm124
color 0A
MODE con: COLS=80 lines=20
set temp=c:\proetempyzh.ini
set num=
cls
:caidan
cls
echo PROE备份工具v1.3
echo ┏━━━━━━━━━━━━━━━┓
echo ┃ 1.上次备份文件名和路径(默认) ┃
echo ┃ ┃
echo ┃ 2.定义备份的文件名和路径 ┃
echo ┃ ┃
echo ┃ 3.清除配置文件 ┃
echo ┃ ┃
echo ┃ 4.定义共享文件夹 ┃
echo ┃ ┃
echo ┃ 5.更新共享文件夹 ┃
echo ┃ ┃
echo ┃ 6.显示工作目录及备份目录信息 ┃
echo ┗━━━━━━━━━━━━━━━┛
echo.
echo 时间%time:~0,8%
echo 日期%date:~0,10%
echo.
set choice=
set /p choice= 请输入功能代码(默认请直接回车):
if "%choice%"=="1" goto main
if "%choice%"=="2" goto din
if "%choice%"=="3" goto clear
if "%choice%"=="4" goto gongxiang
if "%choice%"=="5" goto gengxin
if "%choice%"=="6" goto xianshi
if defined choice goto main
cls


:main
if not exist %temp% echo.&echo 首次使用请定义备份路径&echo.&goto din

:2
call :dywjj ::调用文件变量

::产生临时的proetempbat.bat文件
call :proetempbat
::下面调用D:\Program Files\Wildfire 5.0\i486_nt\obj\purge.exe 来清理垃圾文件
call %batd% %yzh%
if exist %batd% del %batd%

set T=%date:~0,10%-%time:~0,2%%time:~3,2%%time:~6,2%
md "%bak%\%name%-%T%"
copy "%yzh%\*.*" "%bak%\%name%-%T%"

call :loop ::加入结束"完"字
ping -n 2 127.0.0.1>nul 关闭窗口延时1秒

exit



:din
cls

set yzh=""
set bak=""
set name=""
:yzh
set /p yzh=请输入需要备份的路径:
if %yzh%=="" cls&echo 输入错误,请重新输入&pause>nul&cls&goto yzh
:bak
set /p bak=请输入备份到哪个目录:
if %bak%=="" cls&echo 输入错误,请重新输入&pause>nul&cls&goto bak
:name
set /p name=请输入备份文件的头文件名:
if %name%=="" cls&echo 输入错误,请重新输入&pause>nul&cls&goto name

echo.&echo 重新输入(Y?)
set rew=
set /p rew= 请输入功能代码(没输错请直接回车):
if not "%rew%"=="" set rew=%rew:~0,1%
cls
if /i "%rew%"=="Y" goto din else (
attrib -h -s %temp%
echo %yzh%>%temp%
echo %bak%>>%temp%
echo %name%>>%temp%
attrib +h +s %temp% )
goto caidan



:clear
if exist "%temp%" (
attrib -h -s %temp% & del "%temp%" /f /q &cls&echo.&echo echo 清除配置完成&echo.

) else (

cls&echo.&echo 没有配置文件需要清除&echo.
)

echo 按任意键返回主菜单
pause>nul
goto caidan


:gongxiang
cls
:g1
set gxml=""
set /p gxml= 请输入共享目录:

if %gxml%=="" echo 输入错误,请重新输入&goto g1
if not exist "%temp%" (
echo.&call :jinggao

)

call :dywjj&set gxml=%gxml%
attrib -h -s %temp%
echo %yzh%>%temp%
echo %bak%>>%temp%
echo %name%>>%temp%
echo %gxml%>>%temp%
attrib +h +s %temp%

cls
echo.&echo.
echo 共享目录设置完成
echo.
echo 按任意键返回主菜单
pause>nul
goto caidan


:gengxin
if not exist "%temp%" (
echo.&call :jinggao

)
call :dywjj
copy %yzh%\*.* %gxml% /y
cls
echo.&echo 已将源文件夹%yzh%■共享到■%gxml%
echo.&&echo 更新完成,按任意键返回主菜单
pause>nul
goto caidan


:xianshi
cls
call :dywjj
echo 当前工作止录是:
echo ********* %yzh% *********
echo.
echo 将备份到:
echo ********* %bak% *********
echo.
echo 备份文件夹的头文件名是:
echo ********* %name% *********
echo.
echo 共享文件夹目录是:
echo ********* %gxml% *********
echo.&echo.&echo.
echo 按任意键返回主菜单
pause>nul
goto caidan





:jinggao
echo.
echo 还没有定义文件名和路径,按任意键返回主菜单
pause
goto caidan
goto :eof


:dywjj
set numb=1
for /f "delims=" %%i in (%temp%) do (
if !numb!==1 set yzh=%%i
if !numb!==2 set bak=%%i
if !numb!==3 set name=%%i
if !numb!==4 set gxml=%%i
set /a numb+=1
)
goto :eof



:loop
call :setwan
set /a num+=1
echo !%num%!
if %num% LSS 16 goto loop
goto :eof


:proetempbat
set batd="c:\proetempbat.bat"
set drectory="D:\Program Files\Wildfire 5.0\i486_nt\obj\purge.exe"

rem 设置purge.exe文件的路径
set eee=cd ^%%1
call :dywjj
echo %panfu%>%batd%
echo %eee%>>%batd%
echo %drectory%>>%batd%
goto :eof












:setwan
set 1= ┏┓
set 2= ┗┛
set 3= ┏━━━━━━━━━━━━━━━━┓
set 4= ┃┏━━━━━━━━━━━━━━┓┃
set 5= ┃┃ ┏━━━━━━━┓ ┃┃
set 6= ┗┛ ┗━━━━━━━┛ ┗┛
set 7= ┏━━━━━━━━━━━┓
set 8= ┗━━━━━━━━━━━┛
set 9= ┏┓ ┏┓
set 10= ┃┃ ┃┃
set 11= ┃┃ ┃┃
set 12= ┃┃ ┃┃
set 13= ┃┃ ┃┃
set 14= ┃┃ ┃┃ ┏┓
set 15= ┏┛┗┓ ┃┗━━┛┃
set 16= ┗━━┛ ┗━━━━┛



相关推荐
相关主题
热门推荐