@echo off

copy /b/y NUL %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1 
if ERRORLEVEL 1 goto notadmin 
goto admin

:notadmin
echo This script must be run as administrator. 
echo Right click it and select "Run as Administrator".
goto end

:admin
del %WINDIR%\06CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1 

%~d0
CD %~dp0
echo.
echo TechPowerUp HD 6950 to HD 6970 Flashing Tools
echo *********************************************
echo.
echo The full article can be found at: 
echo http://www.techpowerup.com/articles/overclocking/vidcard/159
echo.
echo Please make sure the BIOS selector switch on your card is in the 2 position.
echo This script will *RESTORE* the original BIOS of your HD 6950.
echo.
echo Press any key to continue or CTRL+C to abort.

pause > NUL

cd winflash
atiwinflash -unlockrom 0

if exist backup.bin (
 atiwinflash -f -p 0 orig.bin
) else (
 echo Backup BIOS not found, flashing a generic HD 6950 reference BIOS.
 atiwinflash -f -p 0 orig.bin
)

echo.

if ERRORLEVEL 0 goto success
echo Winflash reported an error in the flashing process, please watch any on-screen messages.
goto end

:success
echo The flashing process completed sucessfully.
echo. 
echo Please restart your system for the changes to apply.
goto end

:end
echo.
pause