|
Thanks HugoV, that worked for me, Below is my newest script for this program. I think its done, just a little more testing to do.
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Malwarebytes' Anti-Malware, terminateie, 00000001 ; sets program options
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Malwarebytes' Anti-Malware, autosavelog, 00000001 ; sets program options
Run, "C:\Program Files\Malwarebytes' Anti-Malware\mbam.exe" ; opens malwarebyes
Sleep, 5000 ; pauses script for 5s
WinWait Malwarebytes' Anti-Malware ; waits for application to start fully
;WinActivate ; sets focus to the program, uses last found window referenced by WinWait
IFWinExist Malwarebytes' Anti-Malware ; test that program is open
;SetControlDelay, 1000 ; sets mouse clicks to 1s between clicks
ControlClick, Check for Updates, ahk_class ThunderRT6FormDC ; clicks Check for Updates,note this is on another tab
WinWaitActive ahk_class #32770 ; waits for this class window to appear, shows for updates and no updates
Sleep, 1000
IfWinActive,,You have the latest database version ; no updates found
ControlClick, OK, Malwarebytes' Anti-Malware ; clicks OK that no updates were found
else
ControlClick, OK, ahk_class #32770 ; updates found
Sleep, 1000
ControlClick, Perform full scan, Malwarebytes' Anti-Malware ; clicks Perform Full Scan Option
Sleep, 1000
ControlClick, Scan, Malwarebytes' Anti-Malware
Sleep, 1500
ControlClick, Start Scan, Perform full scan ; clicks Start Scan with default selections
WinWaitNotActive ahk_class ThunderRT6FormDC ; waits till the scan form isnt active,wont be active when the next message appears
IfWinNotActive ahk_class #32770
WinActivate
IfWinActive,,No malicious items were detected ; checks for window that means no spyware
{
ControlClick, OK, ahk_class #32770 ; clicks OK that no spyware was found
Sleep, 1000
WinWaitActive ahk_class Notepad ; waits for log to display
WinKill ahk_class Notepad ; closes the logfile displayed in notepad
WinActivate ahk_class ThunderRT6FormDC ; sets focus back to malware bytes main window
Sleep, 1000
ControlClick, Exit, Malwarebytes' Anti-Malware ; nothing to remove, close the program
}
else
IfWinActive,,Show Results ; checks for Show Results text meaning spyware was found
{
ControlClick, OK, ahk_class #32770 ; clicks OK on the found dialoge
Sleep, 1000
ControlClick, Show Results, ahk_class ThunderRT6FormDC ; clicks Show Results
Sleep, 1000
ControlClick, Remove Selected, ahk_class ThunderRT6FormDC ; clicks Remove Selected
}
WinWaitActive ahk_class Notepad ; waits for log to display
WinKill ahk_class Notepad ; closes the logfile displayed in notepad
WinActivate ahk_class #32770 ; sets focus back to the reboot prompt
WinWaitActive,,All selected items removed successfully
Sleep, 1500
ControlClick, Yes, ahk_class #32770 ; clicks yes to restart after spyware removal
ExitApp
|
|