engjcowi Posted June 18, 2010 Posted June 18, 2010 Hi Guys My name is Jamie and im from liverpool england. I do freelance home computer repair and recently got into autoit and think its AMAZING. im still very new at it and feel like bambi trying to walk. Ive started a few little scripts, mainly installers using command line switches which has helped me loads. I would like to start to automate more tasks inthe future though. What i wanted to automate was malwarebytes. I used the switches for command line with /runupdate and /fullscanterminate and they are great however the program only terminates if it doesnt find anything. i have trawled through the forums and cant seem to find anything that will automate it should malware be found. i.e remove the malware found. Has anyone seen anything like this or wrote anything? Thanks in advance for your help. jamie Drunken Frat-Boy Monkey Garbage
l3ill Posted June 18, 2010 Posted June 18, 2010 Sounds like you might need an If Then loop, we would need to see your script to offer any real help though. Bill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
engjcowi Posted June 19, 2010 Author Posted June 19, 2010 ok no problem ive added it here. i just cant get it to notice if mbam has ended then finish its loop or notice that something has been found, and press the button to clean what its found then close expandcollapse popupRun (@ProgramFilesDir & "\Malwarebytes' Anti-Malware\mbam.exe /quickscanterminate" ) do if ProcessExists("mbam.exe") then else if not ProcessExists("mbam.exe") then exit endif WinWait("Malwarebytes' Anti-Malware", "scan completed successfully") If Not WinActive("Malwarebytes' Anti-Malware", "scan completed successfully") Then WinActivate("Malwarebytes' Anti-Malware", "scan completed successfully") WinWaitActive("Malwarebytes' Anti-Malware", "scan completed successfully") Send ("{ENTER}") ;See the results of the scan WinWait("Malwarebytes' Anti-Malware", "Show Results") If Not WinActive("Malwarebytes' Anti-Malware", "Show Results") Then WinActivate("Malwarebytes' Anti-Malware", "Show Results") WinWaitActive("Malwarebytes' Anti-Malware", "Show Results") Send ("{ENTER}") Do until not ProcessExists("mbam.exe") WinWait("Malwarebytes' Anti-Malware", "Remove Selected") If Not WinActive("Malwarebytes' Anti-Malware", "Remove Selected") Then WinActivate("Malwarebytes' Anti-Malware", "Remove Selected") WinWaitActive("Malwarebytes' Anti-Malware", "Remove Selected") Send ("{TAB}") Send ("{TAB}") Send ("{TAB}") Send ("{TAB}") Send ("{ENTER}") ;Clean Successful, restart computer WinWait("Malwarebytes' Anti-Malware", "selected items removed") If Not WinActive("Malwarebytes' Anti-Malware", "selected items removed") Then WinActivate("Malwarebytes' Anti-Malware", "selected items removed") WinWaitActive("Malwarebytes' Anti-Malware", "selected items removed") Send ("{RIGHT}") Send ("{ENTER}") ;Exit malwareBytes WinWait("Malwarebytes' Anti-Malware", "Perform quick scan") If Not WinActive("Malwarebytes' Anti-Malware", "Perform quick scan") Then WinActivate("Malwarebytes' Anti-Malware", "Perform quick scan") WinWaitActive("Malwarebytes' Anti-Malware", "Perform quick scan") Send ("{TAB}") Send ("{ENTER}") else ExitLoop endif until 1=2 Drunken Frat-Boy Monkey Garbage
storme Posted June 20, 2010 Posted June 20, 2010 ok no problem ive added it here. i just cant get it to notice if mbam has ended then finish its loop or notice that something has been found, and press the button to clean what its found then close There were quite a few logical errors in your code that showed up when I ran "tidy" [CTRL]T over it. I've found from exsperience that the following scructure is a good approach when running programs like this. It allowes the program to react to "any" windows that come up in any order so your program won't get stuck if a window is missed. BTW this code is TOTALLY untested I just modified your code. expandcollapse popupRun(@ProgramFilesDir & "\Malwarebytes' Anti-Malware\mbam.exe /quickscanterminate") Sleep(100) ; Wait for Malwarebytes to start (not relly needed but just in case) While ProcessExists("mbam.exe") If WinExists("Malwarebytes' Anti-Malware", "scan completed successfully") Then WinActivate("Malwarebytes' Anti-Malware", "scan completed successfully") WinWaitActive("Malwarebytes' Anti-Malware", "scan completed successfully") Send("{ENTER}") EndIf ;See the results of the scan If WinExists("Malwarebytes' Anti-Malware", "Show Results") Then WinActivate("Malwarebytes' Anti-Malware", "Show Results") WinWaitActive("Malwarebytes' Anti-Malware", "Show Results") Send("{ENTER}") EndIf If WinExists("Malwarebytes' Anti-Malware", "Remove Selected") Then WinActivate("Malwarebytes' Anti-Malware", "Remove Selected") WinWaitActive("Malwarebytes' Anti-Malware", "Remove Selected") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{ENTER}") EndIf ;Clean Successful, restart computer If WinExists("Malwarebytes' Anti-Malware", "selected items removed") Then WinActivate("Malwarebytes' Anti-Malware", "selected items removed") WinWaitActive("Malwarebytes' Anti-Malware", "selected items removed") Send("{RIGHT}") Send("{ENTER}") EndIf ;Exit malwareBytes If WinExists("Malwarebytes' Anti-Malware", "Perform quick scan") Then WinActivate("Malwarebytes' Anti-Malware", "Perform quick scan") WinWaitActive("Malwarebytes' Anti-Malware", "Perform quick scan") Send("{TAB}") Send("{ENTER}") EndIf Sleep(500) ; let the computer do something WEnd Good Luck John Morrison aka Storm-E Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E
engjcowi Posted June 20, 2010 Author Posted June 20, 2010 Thanks ill test shortly Drunken Frat-Boy Monkey Garbage
engjcowi Posted June 20, 2010 Author Posted June 20, 2010 hi ive amended the code and it worked once however im sure that the control id's change. it now just keeps trying to exit the program. can someone else test and see what they get pls or look and see if ive done anything worng in the code thanks expandcollapse popupRun(@ProgramFilesDir & "\Malwarebytes' Anti-Malware\mbam.exe /quickscanterminate") Sleep(100) ; Wait for Malwarebytes to start (not relly needed but just in case) While ProcessExists("mbam.exe") If WinExists("Malwarebytes' Anti-Malware", "scan completed successfully") Then WinActivate("Malwarebytes' Anti-Malware", "scan completed successfully") WinWaitActive("Malwarebytes' Anti-Malware", "scan completed successfully") ControlClick("Malwarebytes' Anti-Malware","OK",2) EndIf ;See the results of the scan If WinExists("Malwarebytes' Anti-Malware", "Show Results") Then WinActivate("Malwarebytes' Anti-Malware", "Show Results") WinWaitActive("Malwarebytes' Anti-Malware", "Show Results") $handle = ControlGetHandle("Malwarebytes' Anti-Malware", "Show Results", "") ControlClick("Malwarebytes' Anti-Malware", "Show Results", $handle) ;ControlClick("Malwarebytes' Anti-Malware","Show Results",350) EndIf If WinExists("Malwarebytes' Anti-Malware", "S") Then WinActivate("Malwarebytes' Anti-Malware", "S") WinWaitActive("Malwarebytes' Anti-Malware", "S") ControlClick("Malwarebytes' Anti-Malware","S",350) EndIf If WinExists("Malwarebytes' Anti-Malware", "Remove Selected") Then WinActivate("Malwarebytes' Anti-Malware", "Remove Selected") WinWaitActive("Malwarebytes' Anti-Malware", "Remove Selected") ControlClick("Malwarebytes' Anti-Malware","Remove Selected",19) EndIf processclose("notepad.exe") ;Clean Successful, restart computer If WinExists("Malwarebytes' Anti-Malware", "selected items removed") Then WinActivate("Malwarebytes' Anti-Malware", "selected items removed") WinWaitActive("Malwarebytes' Anti-Malware", "selected items removed") send("!N") ; ControlClick("Malwarebytes' Anti-Malware","&No",7) EndIf If WinExists("Malwarebytes' Anti-Malware", "Perform quick scan") Then WinActivate("Malwarebytes' Anti-Malware", "Perform quick scan") WinWaitActive("Malwarebytes' Anti-Malware", "Perform quick scan") Send("{TAB}") Send("{ENTER}") EndIf Sleep(500) ; let the computer do something WEnd Drunken Frat-Boy Monkey Garbage
storme Posted June 21, 2010 Posted June 21, 2010 hi ive amended the code and it worked once however im sure that the control id's change. it now just keeps trying to exit the program. can someone else test and see what they get pls or look and see if ive done anything worng in the code thanks Sorry no time to run your code but I'd suggest you add #AutoIt3Wrapper_Run_Debug_Mode=y to the top of your script. Then when you run it in SciTE you'll see all the lines that are executed and what it is doing. Good Luck John Morrison Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E
engjcowi Posted June 21, 2010 Author Posted June 21, 2010 thanks ill check later Drunken Frat-Boy Monkey Garbage
storme Posted June 26, 2010 Posted June 26, 2010 thanks ill check laterSo how did you go? Some of my small contributions to AutoIt Browse for Folder Dialog - Automation SysTreeView32 | FileHippo Download and/or retrieve program information | Get installedpath from uninstall key in registry | RoboCopy function John Morrison aka Storm-E
SpotCheckBilly Posted June 26, 2010 Posted June 26, 2010 (edited) A bit off-topic but relevant. Malwarebyte's Anti-Malware will only ask for a restart if it encounters something that cannot be deleted while the computer is running. To make removal more difficult, malware often ties itself to legitimate processes which of course, have to be stopped before the malicious code can be removed. However, for the most part, restarts are not necessary. Great program, isn't it? Edited June 26, 2010 by SpotCheckBilly [font="Tahoma"]"I was worried 'bout rich and skinny, 'til I wound up poor and fat."-- Delbert McClinton[/font]
engjcowi Posted June 28, 2010 Author Posted June 28, 2010 Yeah it certainly is a great program in fact i love it lol. It helps me out so much. I started to run it and had it working even ran it a few times to be sure. was quite content then started messing around with a portable pro version somone had given me and when i went to run it again it all fell apart. Ill put up code shortly and if you guys wouldnt mind taking a look that would be awesome as i just cant see where its going wrong. Ill add the code in next post Drunken Frat-Boy Monkey Garbage
engjcowi Posted June 28, 2010 Author Posted June 28, 2010 expandcollapse popup#AutoIt3Wrapper_Run_Debug_Mode=y Run (@ProgramFilesDir & "\Malwarebytes' Anti-Malware\mbam.exe /quickscanterminate" ) WinWait("Malwarebytes' Anti-Malware", "scan completed successfully") If Not WinActive("Malwarebytes' Anti-Malware", "scan completed successfully") Then WinActivate("Malwarebytes' Anti-Malware", "scan completed successfully") WinWaitActive("Malwarebytes' Anti-Malware", "scan completed successfully") Send ("{ENTER}") ;See the results of the scan WinWait("Malwarebytes' Anti-Malware", "Show Results") If Not WinActive("Malwarebytes' Anti-Malware", "Show Results") Then WinActivate("Malwarebytes' Anti-Malware", "Show Results") WinWaitActive("Malwarebytes' Anti-Malware", "Show Results") Send ("{TAB}") Send ("{TAB}") Send ("{TAB}") Send ("{ENTER}") WinWait("Malwarebytes' Anti-Malware", "Remove Selected") If Not WinActive("Malwarebytes' Anti-Malware", "Remove Selected") Then WinActivate("Malwarebytes' Anti-Malware", "Remove Selected") WinWaitActive("Malwarebytes' Anti-Malware", "Remove Selected") Send ("{TAB}") Send ("{TAB}") Send ("{TAB}") Send ("{TAB}") Send ("{ENTER}") sleep(100) ;Clean Successful, restart computer WinWait("Malwarebytes' Anti-Malware", "selected items have been removed") If Not WinActive("Malwarebytes' Anti-Malware", "selected items have been removed") Then WinActivate("Malwarebytes' Anti-Malware", "selected items have been removed") WinWaitActive("Malwarebytes' Anti-Malware", "selected items have been removed") Send ("{RIGHT}") Send ("{ENTER}") ProcessClose("notepad.exe") ;Exit malwareBytes WinWait("Malwarebytes' Anti-Malware", "Perform quick scan") If Not WinActive("Malwarebytes' Anti-Malware", "Perform quick scan") Then WinActivate("Malwarebytes' Anti-Malware", "Perform quick scan") WinWaitActive("Malwarebytes' Anti-Malware", "Perform quick scan") ProcessClose("mbam.exe") Drunken Frat-Boy Monkey Garbage
engjcowi Posted June 28, 2010 Author Posted June 28, 2010 expandcollapse popup#AutoIt3Wrapper_Run_Debug_Mode=y Run (@ProgramFilesDir & "\Malwarebytes' Anti-Malware\mbam.exe /quickscanterminate" ) WinWait("Malwarebytes' Anti-Malware", "scan completed successfully") If Not WinActive("Malwarebytes' Anti-Malware", "scan completed successfully") Then WinActivate("Malwarebytes' Anti-Malware", "scan completed successfully") WinWaitActive("Malwarebytes' Anti-Malware", "scan completed successfully") Send ("{ENTER}") ;See the results of the scan WinWait("Malwarebytes' Anti-Malware", "Show Results") If Not WinActive("Malwarebytes' Anti-Malware", "Show Results") Then WinActivate("Malwarebytes' Anti-Malware", "Show Results") WinWaitActive("Malwarebytes' Anti-Malware", "Show Results") Send ("{TAB}") Send ("{TAB}") Send ("{TAB}") Send ("{ENTER}") WinWait("Malwarebytes' Anti-Malware", "Remove Selected") If Not WinActive("Malwarebytes' Anti-Malware", "Remove Selected") Then WinActivate("Malwarebytes' Anti-Malware", "Remove Selected") WinWaitActive("Malwarebytes' Anti-Malware", "Remove Selected") Send ("{TAB}") Send ("{TAB}") Send ("{TAB}") Send ("{TAB}") Send ("{ENTER}") sleep(100) ;Clean Successful, restart computer WinWait("Malwarebytes' Anti-Malware", "selected items have been removed") If Not WinActive("Malwarebytes' Anti-Malware", "selected items have been removed") Then WinActivate("Malwarebytes' Anti-Malware", "selected items have been removed") WinWaitActive("Malwarebytes' Anti-Malware", "selected items have been removed") Send ("{RIGHT}") Send ("{ENTER}") ProcessClose("notepad.exe") ;Exit malwareBytes WinWait("Malwarebytes' Anti-Malware", "Perform quick scan") If Not WinActive("Malwarebytes' Anti-Malware", "Perform quick scan") Then WinActivate("Malwarebytes' Anti-Malware", "Perform quick scan") WinWaitActive("Malwarebytes' Anti-Malware", "Perform quick scan") ProcessClose("mbam.exe") Drunken Frat-Boy Monkey Garbage
engjcowi Posted July 16, 2010 Author Posted July 16, 2010 anyone had any joy? Drunken Frat-Boy Monkey Garbage
DOTCOMmunications Posted October 20, 2010 Posted October 20, 2010 Might try the following: mbam.exe with /scan (quick, full or flash), terminate, silent (hides GUI), reboot and also remove (silent, reboot, remove and flash scan require registration)
Cars0n66 Posted July 20, 2011 Posted July 20, 2011 in run box run this to do full scan and terminate. "C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe" /scan -full -terminate
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now