Jump to content

Recommended Posts

Hey guys, im new here; been trawling the forums the last couple of days trying to get an answer to my question..

I can get MBAM to update from the command line, but can't get it to update from a batch file. I can get it to install and do a quickscan in my script, but the /runupdate or /updateshowdialog just doesn't want to seem to run..

Heres a snippet of my script..

:mbytesclsecho Malwarebytes is now installingecho Please wait...mbam-setup.exe /SILENT /SUPPRESSMSGBOXES /DIR="c:\mbam"echo.echo Installation successful!echo.echo.echo Updating Malwarebytes AntiMalware and running a quickscanecho Please wait..call "c:\mbam\mbam.exe" /runupdatecall "c:\mbam\mbam.exe" /quickscanecho.echo Update and scan complete.echo.echo.echo offgoto menu

I don't know whats wrong with it. I've tried the /runupdate /quickscan on the same line, tried it with the Start command as well.

I dunno what I'm doin wrong..

And yes I'm running the batch as administrator.

Link to post
Share on other sites

It could be because you're not letting it install to it's default directory. Have you verified that after installation the program actually is installed in C:\mbam ? Also, does the /quickscan work or does it fail as well. By the way, the call command is unnecessary.

An additional note: you can use /verysilent for the installer instead of /SILENT /SUPPRESSMSGBOXES

Link to post
Share on other sites

It could be because you're not letting it install to it's default directory. Have you verified that after installation the program actually is installed in C:\mbam ? Also, does the /quickscan work or does it fail as well. By the way, the call command is unnecessary.

An additional note: you can use /verysilent for the installer instead of /SILENT /SUPPRESSMSGBOXES

/quickscan works fine, only if /runupdate is above it though,even though the update doesn't work. If the /runupdate isn't there, then when it tries to do a /quickscan it says that 'Malwarebytes' Anti-Malware is already running'. Weird

I'll try and install to default directory and see if that works.

As I say, I can /update it from the command line when MBAM is installed in the c:\mbam folder. Just not from the batch file using the same command.

Link to post
Share on other sites

The issue could be with the installation not completing or MBAM's process being started for some reason. I know you can't do both the update and start the scan at the same time. I have a batch file I use for updating and scanning:

@echo off
"C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe" /runupdate
start "quickscan" "C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe" /quickscanterminate
exit

I don't have to use the start command, but it's nice because it allows it to continue to the exit command so the command window closes while MBAM is scanning.

Link to post
Share on other sites

The issue could be with the installation not completing or MBAM's process being started for some reason. I know you can't do both the update and start the scan at the same time. I have a batch file I use for updating and scanning:
@echo off

"C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe" /runupdate

start "quickscan" "C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe" /quickscanterminate

exit

I don't have to use the start command, but it's nice because it allows it to continue to the exit command so the command window closes while MBAM is scanning.

Yeah that works when I run it stand-alone.

But when I call that batch file from my batch file, then it doesn't wanna update as usual. Did the first time I tried it. Uninstalled MBAM. Restarted PC. Tried script again, and it didn't call the update, just the scan. Even though the virus database is 2/11/2009 which is default for MBAM 1.34.

and to call the batch file im using

call "UpdateMBAM.bat"

Link to post
Share on other sites

Hmm. The only thing I can think of is that for some reason the updater isn't running because the installer isn't exiting completely so it thinks that MBAM.exe is still running or in use. You may have to enter a pause command in there (unfortunately) which would require an additional keypress.

Link to post
Share on other sites

Hmm. The only thing I can think of is that for some reason the updater isn't running because the installer isn't exiting completely so it thinks that MBAM.exe is still running or in use. You may have to enter a pause command in there (unfortunately) which would require an additional keypress.

I don't want to add a pause, because that would defeat the whole purpose of the script

what about this

timeout /t 20

would that work?

or put the commands in seperate batch files, to make sure that the installer has exited properly.

Link to post
Share on other sites

Yes it did work. Here is the ending code.. (just a lil snippet from batch file)

Vista Cleanup Script @ Technibble.com

Register @ TechNibble too!

:mbytesclsecho.echo Malwarebytes is now installingecho Please wait...mbam-setup.exe /VERYSILENT /DIR="C:\MBAM"echo.echo Installation successful!echo.echo.echo Closing installation file and Updating Malwarebytes AntiMalwareecho Please wait..echo.echo.timeout /t 10C:\MBAM\mbam.exe /runupdateecho Closing update and running a quickscanecho Please wait...echo.timeout /t 10C:\MBAM\mbam.exe /quickscanterminateecho.echo.echo Update Complete!echo.echo Quickscan completed!echo.echo offgoto menu
Link to post
Share on other sites

Hi exile360!

Many thanks for this one:

@echo off

"C:\Program\Malwarebytes' Anti-Malware\mbam.exe" /runupdate

start "quickscan" "C:\Program\Malwarebytes' Anti-Malware\mbam.exe" /quickscanterminate

exit

Just what I was looking for!

Is it also possible to add command line parameters for removing threats and quarantine automatically - so to say?

I read about something like that in this thread http://www.malwarebytes.org/forums/index.p...hl=command+line !

Thanks!

Thomas/Sweden!

Link to post
Share on other sites

I just made a small addition to the last log batch file. Now you can run it from any directory not just the log directory.

@echo offset mdir="%UserProfile%\Application Data\Malwarebytes\Malwarebytes' Anti-Malware\Logs"cd %mdir%
dir *.txt /b /on > systext.bakFOR /F "delims=" %%i in (systext.bak) do set sysRunCommand=%%icall "%sysRunCommand%"del /f systext.bak
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
Back to top
×
×
  • Create New...

Important Information

This site uses cookies - We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.