SET SOURCE=C:\Program Files (x86)\Dragon Age\tools\dbbak SET TARGET=C:\Program Files (x86)\Dragon Age\tools\toolssql\Data @Echo off if not exist "%SOURCE%\bw_dragonage_content.bak" goto Sourcemiss if not exist "%TARGET%" goto Targetmiss :returnme if not exist "%PROGRAMFILES(X86)%\Microsoft SQL Server\90\Tools\Binn\" goto SQLmiss64 SET varprogs=%PROGRAMFILES(X86)% goto apply :SQLmiss64 if not exist "%ProgramFiles%\Microsoft SQL Server\90\Tools\Binn\" goto SQLmiss32 SET varprogs=%ProgramFiles% goto apply :apply Echo Running SQLcmd... "%varprogs%\Microsoft SQL Server\90\Tools\Binn\"sqlcmd -S .\BWDATOOLSET -E -Q "RESTORE DATABASE bw_dragonage_content FROM DISK = '%SOURCE%\bw_dragonage_content.bak' WITH MOVE 'bw_dragonage_content' TO '%TARGET%\bw_dragonage_content.mdf', MOVE 'bw_dragonage_content_log' TO '%TARGET%\bw_dragonage_content.ldf'" goto End :Sourcemiss Echo SOURCE not found. (bw_dragonage_content.bak) Please check. Echo Edit this File with Notepad and reapply correct location. goto End :Targetmiss Echo TARGET directory does not exist and will be created: %Target% PAUSE mkdir "%TARGET%" if not exist "%TARGET%" goto Stillmiss goto returnme :Stillmiss Echo TARGET Directory creation failed. Please check. goto End :SQLmiss32 Echo SQL is missing. Please check location (Windows 32bit): %PROGRAMFILES%\Microsoft SQL Server\90\Tools\Binn\ Echo SQL is missing. Please check location (Windows 64bit): %PROGRAMFILES(X86)%\Microsoft SQL Server\90\Tools\Binn\ Echo Edit this file with Notepad and apply correct location. goto end :End PAUSE