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.
by Gary Ward
08 Apr 2009 at 20:06
Hi,
I am not a computer guru so I am having a difficult time following these instructions on how to schedule a malwarebytes scan. I am not clear on where you put in the info you gave? You will have to be somewhat more detailed if you want me to use it, sorry. If you could email me a simpleton’s instructions or for dummy’s I would really appreciate any help.
Thanks,
Gary
by Richard Kreider
08 Apr 2009 at 23:46
@Gary,
The 3 variables inside the batch file are:
set STARTTIME=23:00
set DAYSOFWEEK=M,T,W,Th,F,S,Su
set PATHTOMBAM=”C:\Program Files\Malwarebytes’ Anti-Malware\mbam.exe”
STARTTIME, DAYSOFWEEK, and PATHTOMBAM
You probably don’t need to change PATHTOMBAM unless you did an advanced install and installed the software in an unusual (non-default) location.
STARTTIME just replace 23:00 with a time (24 hour) you want to have the scan run. I used 23:00 (11PM) in my example. If you wanted 3AM you would specify 03:00.
DAYSOFWEEK you can specify which days to run the scan at the given STARTTIME. In my example, I used all 7 days. If you just wanted Monday, Wednesday and Friday scans you would change DAYSOFWEEK to this:
DAYSOFWEEK=”M, W, F”
PATHTOMBAM as I mentioned, you probably don’t need to modify this variable.
So, what you will do is download the batch file (http://www.techish.net/files/mbam_scheduler.bat) and save it to your desktop. You can download it by Right-Clicking on the link and selecting “Save Link As…” and save it to your Desktop.
Once you save it, locate the icon on the desktop named “mbam_scheduler.bat” and right-click on it and select “Edit”.
That should open up a text file with a handful of lines.
Locate the following three lines:
set STARTTIME=23:00
set DAYSOFWEEK=M,T,W,Th,F,S,Su
set PATHTOMBAM=”C:\Program Files\Malwarebytes’ Anti-Malware\mbam.exe”
Those are where you make the modifications. Once completed, save the file and close the editor.
To schedule the job, simply double-click the “mbam_scheduler.bat” icon on your desktop and it will schedule it. After you double click the batch file, you can just delete it if you like.
Let me know if you have further issues. (I didn’t see an email to send this to so I submitted it as a comment)
Thanks,
Rich
by Barb
17 Jun 2009 at 11:43
Can this bat file be programed to do a FULL scan instead of a quick one.
Pingback
by Techish » Google, MSN, Yahoo Search 7.7.7.0 Redirector Malware HiJack
27 Nov 2009 at 10:06
[...] Scan’. If you want to schedule the scanner to scan at a certain time, please see my post http://www.techish.net/2009/01/24/malwarebytes-scheduled-scanning-updating-using-windows/ for further information on how to do this. UPDATE (1/29/2009 9:18PM [...]
by Richard Kreider
27 Nov 2009 at 12:26
@Barb,
Yes, use the /fullscanterminate instead of /quickscanterminate
by Mike
05 Mar 2010 at 13:17
does this work with vista/win7 if not how would you make this work in vista/win7?