I put on my PC some scheduled tasks which are executed during the night (administrator rights granted) in which I included .bat (this is a test version, not the final one):
rem test malware
echo Start of test
cd "C:\Program Files (x86)\Malwarebytes"
mbam.exe /logtofile %TEMP%\scanMbam.log /update -silent
echo After update ERRORLEVEL %ERRORLEVEL%
mbam.exe /logtofile %TEMP%\scanMbam.log /scan -quick -log -silent -remove -reboot
echo After scan ERRORLEVEL %ERRORLEVEL%
My goal is:
- update database
- perform a quick scan
- display a message if any thread detected (not included, yet, I imagined to do this using the test of %ERRORLEVEL%)
- collect the logs in well identified file
- exit the .bat once all above actions performed
The script execution last 8 seconds, which seems to me to be extremely short,
The database is not updated (the interface shows the old version of database)
The %ERRORLEVEL% is always 0 (this can be correct as there is no detection)
The log file is not created
I use registered Pro version of Malwarebytes.
Please let me know what is wrong in my approach.
Also with option -reboot, if the computer is rebooted, is the script going to continue its processing in order to perform other tasks , or shall I put mbem.exe with this option as the very last step of my script?
Thank you in advance for your help