@ECHO OFF if not exist g:\ goto :NoGDrive if "%1" NEQ "" goto :passedparam set /p DBNAME=Restore Database[%_DBNAME_TOG%]: || set DBNAME=%_DBNAME_TOG% SETX _DBNAME_TOG %DBNAME% goto :paramdone :passedparam set DBNAME=%1 :paramdone xcopy C:\Development\Proms\Formats\fmtall\. c:\development\fmtall /Y if ERRORLEVEL 1 GOTO :OOPS xcopy c:\Development\Proms\Formats\genmacall\. c:\development\genmacall /Y if ERRORLEVEL 1 GOTO :OOPS for /F "tokens=1" %%i in ('"DIR /B /OD G:\Backup2008\%DBNAME%\*.bak"') DO SET _FileName=G:\Backup2008\%DBNAME%\%%i ECHO Copy Formats "%_FileName%" to VEPROMS_G%DBNAME% "C:\Development\Proms\VEPROMS User Interface\bin\Debug\VEPROMS.exe" /UF=C:\Development /P= /DB=._SQL2008Express:VEPROMS_G%DBNAME% if ERRORLEVEL 1 GOTO :OOPS ECHO Restored "%_FileName%" to VEPROMS_G%DBNAME% timeout /T 10 goto :eof :NoGDrive Echo No G Drive :oops @ECHO ON Pause