I created the attached agent procedure just today. When I schedule it to run, I get a message that it completed successfully, However, when I open MWB, I get a message still that the database is old. I need this to work on 32 and 64 bit machines. Can someone help me fix this, please?
on my installation the executable appears to be mbam-msp.exe
I double checked our install on several machines, they are all using mbam.exe. I ran the command mbam.exe /runupdate manually from a command prompt on a few of those, and it updated fine. I'm not sure why my procedure is not working.
I didn't actually import the script, but I want to point out that you don't need to check for 64-bit at all. Just run the shell command normally as 32-bit. If the OS happens to be 64-bit, the command will be redirected for you.
Also, you might have better luck if you use Execute File instead of Execute Shell Command. With Execute File, you will actually get an error if something else is wrong.
I created a new procedure, Execute Shell Command, and called mbam.exe /runupdate. It ran as logged in user, and I did not check the 64 bit box. Scheduled the procedure, it successfully ran. Opened MWB and got a message that my database is outdated still.
I created a new procedure, Execute File, and put in the path C:\Program Files (x86)\Malwarebytes' Anti-Malware\mbam.exe, then added the /runupdate arguments to pass to the executable.. That one worked fine, but the path is wrong for 32 bit. How do I set it up so it will work on 32 and 64 bit?
Take the (x86) out of the path. You don't need it.
The reason it works is because the agent itself is 32-bit and it will get redirected to the (x86) folder anyway!
I took out the (x86). The Execute File procedure ran just fine on the 32 bit machines I tested, but it failed on the 64 bit machine, saying the path could not be found.
On 32 bit, the path is C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe
On 64 bit, it is C:\Program Files (x86)\Malwarebytes' Anti-Malware\mbam.exe
Attached is the agent procedure I am now trying to make work. It works fine on 32 bit as you see it, no go on 64 bit.
I think the switch changed from "mbam.exe /runupdate" to "mbam.exe /update -silent" after version 1.5 came out. I wonder if that is what's messing you up?
Check the help file within Malwarebytes. It has a pretty good section on Command Line Parameters.
The /runupdate command does work on 64 bit and 32 bit though. But also, we have version 1.50.
Isn't there a way to tell a procedure to check for 32 or 64 bit, then execute a command based on what bit it is?
Yeah, you could always do a Check Variable #vMachine.OsInfo# contains "x64". True is 64-bit and false is 32-bit.
I think it's weird that it doesn't work the other way though.
I did some testing on this and it was bugging me that if you have an
un-registered version you can't do a silent, no interaction, update. I
found a work-around but it is a gray area so I strongly urge you to
consider MalwareBytes EULA and the customer you deploy the work-around
for before you do so. A mom and pop shop with only a few pc's you can
probably get away with it. For a real corporation you probably want
them to buy the corporate version or resell Kaseya's managed version.
With the unregistered version you can simply run the mbam.exe
/update which then updates and prompts the user with an OK | Cancel
dialogue box. Turns out that no matter which button they choose the
process still gets updated. So, I run the update as system to put it in
the background, then after a specified amount of time I just kill the
process via taskkill from the command prompt. 5 minutes is probably
overkill but I want to take bandwidth into consideration. I've tested on only a few machines so far including Win7 and XP.