@echo off
cls
for /f %%A in ("%~dp0") do set cesta=%%~fA

REM ODEBRAT
if "%cesta:~-1,1%"=="\" set cesta=%cesta:~0,-1%

taskkill.exe /f /t /im Bginfo.exe > nul 2>&1

copy /y "%cesta%\Bginfo.bgi" "%WINDIR%"> nul 2>&1
copy /y "%cesta%\Bginfo.exe" "%WINDIR%"> nul 2>&1

if exist "%WINDIR%\Bginfo.exe" if exist "%WINDIR%\Bginfo.bgi" start "" /wait "%WINDIR%\Bginfo.exe" "%WINDIR%\Bginfo.bgi" /SILENT /TIMER:0 /ACCEPTEULA
if exist "%WINDIR%\Bginfo.exe" if exist "%WINDIR%\Bginfo.bgi" reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v BGInfo /t REG_SZ /d "\"%WINDIR%\Bginfo.exe\" \"%WINDIR%\Bginfo.bgi\" /SILENT /TIMER:0 /ACCEPTEULA" /f
exit /b 0