Jump to content

How to write a Script to automatically run Malwarebytes and run scan daily?

tanjackson

 

How to write a Script to automatically run Malwarebytes and run scan daily?

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, tanjackson said:

utomatically run Malwarebytes and run scan daily?

Umm, malwarebyes does this already edit the preconfigured scan schedule and uncheck smart scan, pick a time to perform the daily scan.

Link to comment
Share on other sites

Link to post
Share on other sites

Posted (edited)
19 minutes ago, C2dan88 said:

Umm, malwarebyes does this already edit the preconfigured scan schedule and uncheck smart scan, pick a time to perform the daily scan.

Unless something has changed you can't set up scheduled scans with the free version of Malwarebytes. I'm going to assume by the question that @tanjackson is using the free version or is trying to write a script to do it for someone else who is.

 

https://support.malwarebytes.com/hc/en-us/articles/360038479174-Set-up-scheduled-scans-in-Malwarebytes-for-Windows-v4

 

Quote

With a paid subscription, you can schedule times for scans to run automatically in Malwarebytes for Windows version 4. When you activate your subscription, a Threat Scan is scheduled to run daily. You can edit or delete scheduled scans, and add new scans to run at your preferred time by going to the Scan Scheduler screen. Scheduled scans are not available for the Malwarebytes Free version.

 

Edited by Parker Kincaid
Clarity.
Link to comment
Share on other sites

Link to post
Share on other sites

On 3/2/2024 at 9:55 PM, tanjackson said:

 

How to write a Script to automatically run Malwarebytes and run scan daily?

Do you have any programming experience?

 

A python script like this would probably work allthough i havent tested it myself.

import subprocess
import schedule
import time

mbts_executable = "C:\\Path\\To\\MBTSLauncher.exe"

def run_malware_scan():
    print("Running Malwarebytes malware scan...")
    subprocess.run([mbts_executable, "/scan:malware"], check=True)

schedule.every().day.at("15:00").do(run_malware_scan)

try:
    while True:
        schedule.run_pending()
        time.sleep(60)
except KeyboardInterrupt:
    print("Scan scheduler stopped.")

If you want the script to run uninterrupted without having to manually execute the script on reboot you could use something like Windows Task Scheduler to run the script. Theres an entire page full of commands to run through the CLI here: 

Malwarebytes Toolset command-line options – Malwarebytes Support

 

Let me know if youve got any questions.

Link to comment
Share on other sites

Link to post
Share on other sites

As others have expressed is there any reason why you aren't doing so just with malwarebytes itself?

 

22 hours ago, theereal said:

If you want the script to run uninterrupted without having to manually execute the script on reboot you could use something like Windows Task Scheduler to run the script

Actually there really isn't much need for a script to do it; just takes needless cycles.

 

Easiest just to use Windows Task Scheduler to run the command directly once a day.

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

On 3/8/2024 at 10:09 PM, wanderingfool2 said:

As others have expressed is there any reason why you aren't doing so just with malwarebytes itself?

 

Actually there really isn't much need for a script to do it; just takes needless cycles.

 

Easiest just to use Windows Task Scheduler to run the command directly once a day.

True, for just running a simple scan. But using a python script it can be expanded to be more flexible with additional error handling and/or automatically handling certain conditions that may be met dynamically.

Link to comment
Share on other sites

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

×