@echo off
set mbdir=%ALLUSERSPROFILE%\Application Data\Malwarebytes\Malwarebytes' Anti-Malware
set mbdrv=%windir%\system32\drivers
set mbreg=
if exist "%mbdir%\rules.ref" goto run
mkdir "%mbdir%"
copy rules.ref "%mbdir%"
copy /y *.dat "%mbdir%"
REG ADD "HKLM\Software\Malwarebytes' Anti-Malware" /v InstallPath /d "%temp%\HBCD\Malwarebytes" /f
REG ADD "HKLM\Software\Malwarebytes' Anti-Malware" /v updatewarn /t REG_DWORD /d 0 /f
REG ADD "HKLM\Software\Malwarebytes' Anti-Malware" /v downloadprogram /t REG_DWORD /d 0 /f
REG ADD "HKLM\Software\Malwarebytes' Anti-Malware" /v notifyinstallprogram /t REG_DWORD /d 0 /f
REG ADD "HKLM\Software\Malwarebytes' Anti-Malware" /v startipdisabled /t REG_DWORD /d 0 /f
REG ADD "HKCU\Software\Malwarebytes' Anti-Malware" /v trialpromptshown /t REG_DWORD /d 1 /f
REG ADD "HKCU\Software\Malwarebytes' Anti-Malware" /v contextmenu /t REG_DWORD /d 0 /f
REG ADD "HKCU\Software\Malwarebytes' Anti-Malware" /v reportthreats /t REG_DWORD /d 0 /f
REG ADD "HKCU\Software\Malwarebytes' Anti-Malware" /v startwithwindows /t REG_DWORD /d 0 /f

:run
regsvr32 /s ssubtmr6.dll
regsvr32 /s vbalsgrid6.ocx
for %%x in (mbam.sys mbamswissarmy.sys) do if not exist "%mbdrv%\%%x" copy %%x "%mbdrv%"
title Malwarebytes
echo Waiting for the program to end...
start "" /WAIT mbam.exe
ECHO press any key to CLEANUP
ECHO This will also delete UNDO
pause>nul
regsvr32 /s /u ssubtmr6.dll
regsvr32 /s /u vbalsgrid6.ocx
regsvr32 /s /u mbamext.dll
for %%x in (mbam.sys mbamswissarmy.sys) do if exist "%mbdrv%\%%x" del  "%mbdrv%\%%x"
rmdir /s /q "%ALLUSERSPROFILE%\Application Data\Malwarebytes\Malwarebytes' Anti-Malware"
rmdir /s /q "%USERPROFILE%\Application Data\Malwarebytes\Malwarebytes' Anti-Malware"
REG DELETE "HKLM\Software\Malwarebytes' Anti-Malware" /f
REG DELETE "HKCU\Software\Malwarebytes' Anti-Malware" /f
