@echo off&setlocal enabledelayedexpansion
color 0a
echo.=====================================
echo.欢迎使用Oracle数据库自动备份还原工具
echo.作者:乔磊 MSN:sucre03@live.cn
echo.=====================================
for /f "tokens=2 delims==" %%a in ('path') do (
set "str=%%a"
set str=!str: =+!
for %%i in (!str!) do (
set "var=%%i"
set var=!var:+= !
echo !var!>>%temp%\change.txt
for /f "delims=" %%i in ('findstr "Db_1\bin" %temp%\change.txt') do set var=%%i
)
)
set /p name=用户名(username):
chcp 437 >nul
graftabl 936 >nul
>"%temp%\in.com" echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5x
set /p=请输入密码:
for /f "tokens=*" %%a in ('"%temp%\in.com"') do (
set "password=%%a"
)
set /p sid=空间标识(SID):
:start
set /p choice=1.导出 2.导入 3.退出:
if %choice%==1 goto exp
if %choice%==2 goto imp
if %choice%==3 goto end
:exp
set /p file=给导出的文件起个名:
set /p path=存放的路径(记得输冒号:):
"%var%"\exp.exe %name%/%password%@%sid% file=%path%\%file% full=n
set /p choice=1.继续(输入c) 2.退出(输入e)
if %choice%==c goto start
if %choice%==e goto end
:imp
set /p file=请将要导入的数据库文件拖入窗体内:
"%var%"\imp.exe %name%/%password%@%sid% file=%file% full=y
set /p choice=1.继续(输入c) 2.退出(输入e)
if %choice%==c goto start
if %choice%==e goto end
:end
del /q %temp%\change.txt
del /q %temp%\in.com
exit