Jump to content

Update MBAM Version via Batch File Silently


Recommended Posts

Hello, 

Let me start by saying that I have searched for this answer already in the forum and have not found one. 

I work from home by myself on my own computer. 

I always get a pop up saying new version available to install. 

I do not have the time to go to update my version manually during the day. I want my computer to update the version during the night. 

I want to create a task in task scheduler that will run a batch file at midnight every night that will check for VERSION updates and install the update. 

I just want to update the *version* at midnight in a batch file that i schedule through task manager.

Can anyone help with this?

Thank you so much for the help in advance!

Edited by jsobo99
Link to post
Share on other sites

Hello and Welcome...

Sounds like you are in need of changing your license over to the business version.  That version has a way to manage all the client computers.  The home version was really meant to be for home users.

There is no way to update MB3 Home Premium using scripts, batch files or task scheduler (all these tasks are in the business version)

You may want to reach out to the business section here: Malwarebytes Endpoint Protection

Link to post
Share on other sites

I think the best we can do for the home version would be in case the installer has been downloaded, to then add a task to Task Scheduler that will execute the new version's installer with some CLI switches to manage the upgrade process, though how truly silent and automatic you can make it, I do not know as it's not really something I've tried before.

First off is the location.  You'll need your command to execute the upgrade installer from where it gets saved which, I believe, is currently in this folder by default: C:\ProgramData\Malwarebytes\MBAMService\instlrupdate

Next, you have to point to the installation file to run it and at this time at least, the naming scheme should be something along the lines of mb3-setup-consumer-#.#.#.####.exe however you should be able to use a wildcard such as *.exe to execute it as long as it only stores the most recent installer in that location (which I believe it does).  Then you'll need to include the appropriate switches which, since Malwarebytes uses InnoSetup installation packages for the consumer version currently, can be found here.  I'll have to leave it to you to determine what switches you need for your purposes and to discover what is and is not possible via the available command line switches.

Finally, since I assume you don't want your task to constantly run every single night reinstalling the same version that is currently installed, you'll also need to include some sort of cleanup command to clear the folder once it is done.  This should be fairly simple as long as you include a system restart following your upgrade installs since you could then insert a second scheduled task which deletes all .exe files contained in the path listed above (just be sure it only runs at startup so that you don't accidentally delete an installer for an upgrade you haven't installed yet).  You can also insert an "IF" statement in your install/upgrade scheduled task to check for the existence of an .EXE file in that location to determine if launching the upgrade process is necessary that way you don't have constant errors when no installer is present due to the lack of a new upgrade being made available.

The one big caveat here is that usually new major upgrades get rolled out gradually so the only way to guarantee that you always have he absolute latest is to use the Install Application Updates button located under the Settings>Application tab (there is no CLI switch to force this update check that I know of at this time for the consumer version of MB3) so it's still possible for a system set up with these scheduled tasks to not necessarily always be up-to-date with the latest build.

Anyway, I hope this helps.  It might not be a perfect solution, particularly since many upgrades don't even require a reboot, however it's the cleanest, most robust solution I could come up with given the requirements you laid out.

Link to post
Share on other sites

This sounds like something else may be going on. We have only released a new installer approximately every 3 months, and this is the only time you should be prompted for an upgrade. We have done almost monthly updates that install silently in the background, without requiring user interaction.

Any chance you can grab the logs from the page below so I can check out some of the logs from your machine?

 

Link to post
Share on other sites

By the way, regarding my instructions above, I was reminded that self-protection will prevent deletion of the installer so you'd either need to disable it or use an alternate method such as renaming the file via an early start method such as the Pending File Rename Operations reg key described here.

Were it me, I'd just disable self-protection as that makes working with MB3's files/structure much easier.

Link to post
Share on other sites

On 12/7/2017 at 11:50 AM, exile360 said:

I think the best we can do for the home version would be in case the installer has been downloaded, to then add a task to Task Scheduler that will execute the new version's installer with some CLI switches to manage the upgrade process, though how truly silent and automatic you can make it, I do not know as it's not really something I've tried before.

First off is the location.  You'll need your command to execute the upgrade installer from where it gets saved which, I believe, is currently in this folder by default: C:\ProgramData\Malwarebytes\MBAMService\instlrupdate

Next, you have to point to the installation file to run it and at this time at least, the naming scheme should be something along the lines of mb3-setup-consumer-#.#.#.####.exe however you should be able to use a wildcard such as *.exe to execute it as long as it only stores the most recent installer in that location (which I believe it does).  Then you'll need to include the appropriate switches which, since Malwarebytes uses InnoSetup installation packages for the consumer version currently, can be found here.  I'll have to leave it to you to determine what switches you need for your purposes and to discover what is and is not possible via the available command line switches.

Finally, since I assume you don't want your task to constantly run every single night reinstalling the same version that is currently installed, you'll also need to include some sort of cleanup command to clear the folder once it is done.  This should be fairly simple as long as you include a system restart following your upgrade installs since you could then insert a second scheduled task which deletes all .exe files contained in the path listed above (just be sure it only runs at startup so that you don't accidentally delete an installer for an upgrade you haven't installed yet).  You can also insert an "IF" statement in your install/upgrade scheduled task to check for the existence of an .EXE file in that location to determine if launching the upgrade process is necessary that way you don't have constant errors when no installer is present due to the lack of a new upgrade being made available.

The one big caveat here is that usually new major upgrades get rolled out gradually so the only way to guarantee that you always have he absolute latest is to use the Install Application Updates button located under the Settings>Application tab (there is no CLI switch to force this update check that I know of at this time for the consumer version of MB3) so it's still possible for a system set up with these scheduled tasks to not necessarily always be up-to-date with the latest build.

Anyway, I hope this helps.  It might not be a perfect solution, particularly since many upgrades don't even require a reboot, however it's the cleanest, most robust solution I could come up with given the requirements you laid out.

Exile360,

 

Thank you SO much for your help yesterday. With the information that you gave me I was able to create a batch file to update my version of Malwarebytes. 

While I have your help, can I ask you is there any way to turn off the setting "Notify me when full version updates are available" without having console access? Perhaps through regedit or any other means? Is there anyway to script it? Again I looked through the forums everywhere and I don't see anybody discussing this as well. It is really annoying and I'm considering installing it on both my mom and dad's home laptops.

I have attached a screenshot of the setting in the Malwarebytes application. 

Thank you so much for your help! I really appreciate it!

 

 

MBAM-Setting.jpg

Link to post
Share on other sites

What dcollins says above is correct.  MB3 stores its settings in encrypted configuration files stored in one of MB3's data folders.  They cannot be manipulated via the registry or any other automated/scripted means unless you have a build of MB3 that accepts script commands/switches directly (the consumer build does not, however I do believe that at least some of the business builds do) so that is a setting you'll have to manipulate manually or just live with.

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.