@ECHO off
blat -install smtp.mrcuk.mr-carpet.co.uk mrcadmin@mr-carpet.co.uk
:menu
cls
ECHO *****************************************************************************
ECHO **                            Switch MrC Database                          **
ECHO *****************************************************************************
echo.
echo.
echo                            Make your selection below:
echo.
echo			[1]	Set MrC DB to be active on MRCDB2 (latest backup)
echo.
echo			[2]	Set MrC DB to be active on MRCDB
echo.
echo			[3]	Check which DB server is live
echo.
echo			[4]	Exit
echo.
echo.
%logonserver%\netlogon\CopyToAll\MrC\choice.com /C:1234
if errorlevel=4 goto exit
if errorlevel=3 goto status
if errorlevel=2 goto activemrcdb
if errorlevel=1 goto activemrcdb2

:activemrcdb2
ren \\mrcdb2\e$\_activedb.flg activedb.flg
cls
echo.
echo The ACTIVE database server has now been set to MRCDB2
echo.
echo.
echo.
sleep 10
goto menu

:activemrcdb
cls
echo Before re-activating MRCB, has the latest DB been restored to \\mrcdb#database$ ?
echo.
echo.
pause
ren \\mrcdb2\e$\activedb.flg _activedb.flg
cls
echo.
echo The ACTIVE database server has now been set to MRCDB
echo.
echo.
echo.
sleep 5
goto menu

:status
cls
if exist \\mrcdb2\e$\_activedb.flg echo The active database server is currently set to be MRCDB
if exist \\mrcdb2\e$\activedb.flg echo The active database server is currently set to be MRCDB2
sleep 10
goto menu

:NOTALLOWED
cls
echo Not authorised to run from this PC !!!!!
echo.
echo.
sleep 10

:exit
exit