Using Windows’ “at” command we can schedule a task to be run at a certain time on certain days and even in certain months.

I use MalwareBytes (free version) and one feature that is not available in the free version is scheduled scans (from the interface) and Real-time protection.  I’m not a fan of real-time protection but I do like to the option for scheduled scanning.

Unfortunately, I have not purchased MBAM yet (but plan to in the very near future as it has proven to be a godsend on quite a few occassions).  Here is my method of scheduling MBAM to run an update and quickscan at 11PM on every day of the week.

@echo off
REM MBAM Scan/Update Scheduler
REM http://www.techish.net
REM
REM Make sure Task Scheduler is started
REM     net start | find /I "Task Scheduler"
REM You should see:  Task Scheduler in the output, if not run:
REM     net start "Task Scheduler"
REM
REM Modify the following variables:
REM By default, the scan is set to run at 11PM every night of the week interactively with the logged on user in a minimized state after
REM an update of MBAM.  Once the scan is complete, it terminates should it NOT find any malware.
REM
REM ********* VARIABLES *********
set STARTTIME=23:00
set DAYSOFWEEK=M,T,W,Th,F,S,Su
set PATHTOMBAM="C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe"

REM !!!!!!!! You shouldn't need to modify anything below this !!!!!!!!
at %STARTTIME% /interactive /every:%DAYSOFWEEK% %PATHTOMBAM% /minimized /runupdate /quickscanterminate

The commandline options to MBAM are noted in the CHM in the program directory for it. The ones I used are:

/minimized (self explanatory)
/runupdate (checks for any definition updates and installs them)
/quickscanterminate (runs a quickscan then terminates if no threats are detected)

Review the mbam.chm file in the installation directory for more information to other commandline options for MBAM.

Download MBAM Scheduler (md5sum: B17ACD57B1F4C268B4069C08E1537B20 mbam_scheduler.bat)

Save it to your PC and run it (or modify the variables) and it will schedule the scan/updates for you.

To verify that it is scheduled, open a command prompt (Start -> Run -> cmd (click OK)) and type:  at  You should have similar output:

Status ID   Day                     Time          Command Line
-------------------------------------------------------------------------------
1   Each M T W Th F         11:00 PM      "C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe" /minimized /runupdate /quickscanterminate

To cancel the scheduled task, simply type:

at 1 /delete  (where 1 is the ID of the scheduled job in this example)

If you have questions/problems, leave me a comment.

You might also be interested in...

  • No Related Post