Lee Computer Services : freelance computer/web services

Repair News Articles from the Tech Industry

December 19, 2010

Malwarebytes 1.50 Portable, How To...

This utility has saved me countless hours fixing clients machines hosed up with bugs, run in safemode. The files are installed locally so the usb drive can be removed after starting the scan.

1. You'll need to start by installing a copy of Malwarebytes.

2. Once it's installed, copy the application directory to a folder. Since I simply called my folder "program", you may need to change the script. Something I didn't mention was the %~dp0 command, which will take the drive letter, path and name of the batch file to form the full directory the batch file resides in. Basically, no matter what you do, make sure the Malwarebytes application directory folder is one level deeper than the script. When the script is executed, it'll look in the folder that's just beyond it.

3. Once the application directory folder has all Malwarebytes program files in it, you'll need to copy over the mbam.sys and mbamswissarmy.sys files and put them in the application directory folder. They should be located in the C:\WINDOWS\system32\drivers\ folder. For some reason, sometimes the mbamswissarmy.sys file doesn't show up after being installed. In that case, just copy the mbam.sys file and skip to step 4 . After putting Malwarebytes Portable together, if it works fine I'm sure it'll be ok. If you get Error 723, I'd suggest that you install an older version of Malwarebytes and try to copy the mbamswissarmy.sys from that version. I don't know why sometimes mbamswissarmy.sys isn't included after Malwarebytes is installed. I've seen it happen a few times.

4. Copy the rules.ref definitions file located: "%ALLUSERSPROFILE%\Application Data\Malwarebytes\Malwarebytes' Anti-Malware\" to the application directory folder.

5. Try to run it. Good luck!

put sleep.exe in there too http://www.computerhope.com/download/utility/sleep.exe

PortableMalwarebytes.bat follows

@echo off
title LEAVE THIS BOX OPEN!!!

echo WARNING!!!
echo.
echo If Malwarebytes Portable asks you to restart after scanning, CLICK NO!
echo You'll need to EXIT Malwarebytes Portable and restart manually.
echo.
echo Otherwise, the program files will be left over and Windows will think it's
echo installed.
echo.
echo.
echo If you DO accidentally click restart. Open Malwarebytes and close it manually to delete the program files again.
echo.
echo Continue? {Y N}
set /p MBAM_Warning=
if "%MBAM_Warning%"=="y" goto start
if "%MBAM_Warning%"=="n" goto eof

:start
cls
echo Registering Services...
regsvr32.exe "%~dp0program\vbalsgrid6.ocx" /s
regsvr32.exe "%~dp0program\ssubtmr6.dll" /s
regsvr32.exe "%~dp0program\mbamext.dll" /s

echo Copying Malwarebytes System Files...
COPY "%~dp0program\mbam.sys" "C:\WINDOWS\system32\drivers\mbam.sys" /Y
COPY "%~dp0program\mbamswissarmy.sys" "C:\WINDOWS\system32\drivers\mbamswissarmy.sys" /Y

echo Creating Temp Directory...
mkdir "%ALLUSERSPROFILE%\Application Data\Malwarebytes\Malwarebytes' Anti-Malware"

echo Copying Definitions...
xcopy "%~dp0program\rules.ref" "%ALLUSERSPROFILE%\Application Data\Malwarebytes\Malwarebytes' Anti-Malware" /Y /Q

echo Starting...
"%~dp0program\mbam.exe"

echo Saving new definitions...
xcopy "%ALLUSERSPROFILE%\Application Data\Malwarebytes\Malwarebytes' Anti-Malware\rules.ref" "%~dp0program" /Y /Q
if exist "C:\Program Files (x86)\Malwarebytes' Anti-Malware" goto eof
if exist "C:\Program Files\Malwarebytes' Anti-Malware" goto eof

echo Removing Temp Directory
RMDIR /S /Q "%ALLUSERSPROFILE%\Application Data\Malwarebytes"
RMDIR /S /Q "%USERPROFILE%\Application Data\Malwarebytes"
"%~dp0program\sleep.exe" 750

echo Deleting Malwarebytes System Files...
DEL "C:\WINDOWS\system32\drivers\mbam.sys"
DEL "C:\WINDOWS\system32\drivers\mbamswissarmy.sys"
"%~dp0program\sleep.exe" 750

echo Removing Malwarebytes Registry Entry...
REG DELETE "HKCU\Software\Malwarebytes' Anti-Malware" /f
"%~dp0program\sleep.exe" 750

echo Deleting Malwarebytes Services...
regsvr32.exe /u "%~dp0program\vbalsgrid6.ocx" /s
regsvr32.exe /u "%~dp0program\ssubtmr6.dll" /s
regsvr32.exe /u "%~dp0program\mbamext.dll" /s
"%~dp0program\sleep.exe" 2000
exit
:eof
exit

paste the above in a text file and rename it PortableMalwarebytes.bat
or download here http://files.awesomegeeks.com/2010/03/PortableMalwarebytes.zip

Use Winrar to make sfx Exe
add script as follows

;The comment below contains SFX script commands

Path=c:\windows\temp
SavePath
Setup=PortableMalwarebytes.bat
TempMode
Silent=1
Overwrite=1

add a Malwarebytes icon

http://blog.awesomegeeks.com/2010/03/19/malwarebytes-2-0/

 

blog.awesomegeeks.com

more... »