Jump to content

Automated AV/Spyware scan


Recommended Posts

I fix computers for a living. One common task I do is install Ad-Aware, Spybot, MSAS, and AVG AS. Then I update and run them all. Then, I run online AV scans like Panda and Trend. Then I run Dial-A-Fix. All this takes forever, but has a high percentage of near-complete success with common Spyware/Virus issues. Since there is little thinking to all these procedures, I thought it would be ideal for a script.

Not being one to re-invent the wheel, I wanted to know if an all-in-one completely automated script like this exists. While lurking, I saw similar scripts, but they didn't appear to be completely automated. It also seems Ad-Aware is difficult to script.

Has anyone done all these before?

Link to comment
Share on other sites

  • Moderators

One down, six to go :whistle:

Well that one, should at least give you a foundation to work on :P ... GL

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • 2 months later...

CODE
RunWait(@ProgramFilesDir & "\Spybot - Search & Destroy\SpybotSD.exe /taskbarhide /allhives /autoupdate /autoimmunize /onlyspyware /autocheck /autofix /autoclose, @SW_SHOWDEFAULT")

What are MSAS and Dial-A-Fix? If you find silent install & run switches for them, let me know.

Link to comment
Share on other sites

I also go around the neighbourhood fixing people's computers and teaching them about the marvels of free software (OpenOffice.org, Firefox, Thunderbird, Tuxpaint, etc). And talking about how wonderful Linux is of course. Anyway, most of them prefer to stay with all the annoyances of Windows, so they need help.

I've been scripting AVG, HitmanPro (which did a great job of scripting Ad-Aware, Hitmanpro, and a few others, also with autoit), Ccleaner, Firefox.

Here is the code. OpenOffice.org is in the works:

It all depends on an .ini file: (so that it is easy to modify in case of new versions)

[CCleaner]

url=http://download.piriform.com/ccsetup140.exe

InstallIT=InstallCCleaner.exe

Setup=ccsetup140.exe

[Hitmanpro]

url=http://hitmanpro1.dyndns.org/strider2/link.aspx?name=download

InstallIT=InstallHitmanPro.exe

Setup=hitmanpro26.exe

[Firefox]

url=http://download.mozilla.org/?product=firefox-2.0.0.3&os=win&lang=nl

InstallIT=InstallFirefox.exe

Setup="Firefox Setup 2.0.0.3.exe"

[AVG]

url=http://free.grisoft.com/softw/70free/setup/avg75free_467a1008.exe

InstallIT=InstallAVG.exe

Setup=avg75free_467a1008.exe

[OOo]

url=http://ftp.belnet.be/mirror/ftp.openoffice.org/localized/nl/2.2.0/OOo_2.2.0_Win32Intel_install_wJRE_nl.exe

InstallIT=InstallOOo.exe

Setup=OOo_2.2.0_Win32Intel_install_wJRE_nl.exe

This is the main script, which downloads everything:

; This script requires full Administrative rights
#requireadmin

$workdir="C:\Download"
DirCreate($workdir)

$autofixitdir="C:\autoFix.it"

$inifile = $autofixitdir & "\files2download.ini"
$var = IniReadSectionNames($inifile)
If @error Then 
    MsgBox(4096, "Error occurred, probably no INI file.", "Make sure you copy the autoFix.it folder to C:\")
Else
    For $i = 1 To $var[0]
        $value = IniRead($inifile, $var[$i], "url", "NotFound")

        MsgBox(4096, "", $var[$i] & "  " & $value)

        If $value <> "NotFound" Then
        ;RunWait("C:\autoFix.it\wget " & $value,$workdir)

            $value = IniRead($inifile, $var[$i], "InstallIT", "NotFound")

            MsgBox(4096, "", $var[$i] & "  " & $value)
            
            Run($autofixitdir & "\" & $value)
        Else
            MsgBox(4096, "Error", "Section not found", -3)
        Endif
    Next
EndIf

; This script requires full Administrative rights
#requireadmin

$workdir="C:\Download"

$inifile = "C:\autoFix.it\files2download.ini"
$var = IniReadSectionNames($inifile)

If @error Then 
    MsgBox(4096, "Error occurred, probably no INI file.", "Make sure you copy the autoFix.it folder to C:\")
Else
    $value = IniRead($inifile, "CCleaner", "Setup", "NotFound")
    If $value <> "NotFound" Then
        Run($workdir & "\" & $value)

        $title="Installer Language"
        WinWait($title)
        ControlClick($title, "OK", 1)

        $title="CCleaner"
        WinWait($title)
        ControlClick($title, "Next >", 1)

        WinWait($title)
        ControlClick($title, "I &Agree", 1)

        WinWait($title)
        ControlClick($title, "Next >", 1)

        WinWait($title)
        WinActivate($title)
        
        Send("{SPACE}{TAB}{TAB}{SPACE}{TAB}{SPACE}{TAB}{TAB}{SPACE}")
        Sleep(4000)
        ControlClick($title, "Install", 1)
        
        $title="CCleaner"
        WinWait($title)
        ControlClick($title, "Finish", 1)
    EndIf
EndIf

; This script requires full Administrative rights
#requireadmin

$workdir="C:\Download"

$inifile = "C:\autoFix.it\files2download.ini"
$var = IniReadSectionNames($inifile)

If @error Then 
    MsgBox(4096, "Error occurred, probably no INI file.", "Make sure you copy the autoFix.it folder to C:\")
Else
    $value = IniRead($inifile, "Hitmanpro", "Setup", "NotFound")
    If $value <> "NotFound" Then
        Run($workdir & "\" & $value)

        $title="Select Setup Language"
        WinWait($title)
        WinActivate($title)
        Send("{ENTER}")

        $title="Setup - Hitman Pro"
        WinWait($title)
        WinActivate($title)
        Send("!n"); Welcome

        WinWait($title)
        WinActivate($title)
        Send("!a!n"); License

        WinWait($title)
        WinActivate($title)
        Send("!n"); Destination Location

        WinWait($title)
        WinActivate($title)
        Send("!n"); Create Desktop Icon

        WinWait($title)
        WinActivate($title)
        Send("!i"); Install

        WinWait($title,"Completing")
        WinActivate($title)
        Send("!f"); Finish

        $title="Hitman Pro"
        WinWait($title,"Send")
        WinActivate($title,"Send")
        Send("{ENTER}")

        WinWait($title)
        ControlClick($title, "Setup", 11)

        WinActivate($title)
        Send("{DOWN}{DOWN}{DOWN}{TAB}")
        Sleep(400)
        Send("{DOWN}{DOWN}{DOWN}{SPACE}")
        Sleep(500)
        Send("{DOWN}{DOWN}{SPACE}")
        Sleep(2000)
        Send("+{TAB}+{TAB}+{TAB}+{TAB}+{TAB}+{TAB}")
        Sleep(500)
        Send("{DOWN}{TAB}")
        MsgBox(1, "Check Settings", "Check whether NOD32 Antivirus is switched off")

        ControlClick($title, "Start", 15)
    EndIf
EndIf

; This script requires full Administrative rights
#requireadmin

$workdir="C:\Download"

$inifile = "C:\autoFix.it\files2download.ini"
$var = IniReadSectionNames($inifile)

If @error Then 
    MsgBox(4096, "Error occurred, probably no INI file.", "Make sure you copy the autoFix.it folder to C:\")
Else
    $value = IniRead($inifile, "Firefox", "Setup", "NotFound")
    If $value <> "NotFound" Then
        Run($workdir & "\" & $value)

        $title="Mozilla Firefox"
        WinWait($title)
        ControlClick($title, "", 1)

        WinWait($title)
        Send("!a")
        ControlClick($title, "", 1)

        WinWait($title)
        ControlClick($title, "", 1)

        WinWait($title)
        ControlClick($title, "", 1)
    EndIf
EndIf

; This script requires full Administrative rights
#requireadmin

$workdir="C:\Download"

$inifile = "C:\autoFix.it\files2download.ini"
$var = IniReadSectionNames($inifile)

If @error Then 
    MsgBox(4096, "Error occurred, probably no INI file.", "Make sure you copy the autoFix.it folder to C:\")
Else
    $value = IniRead($inifile, "AVG", "Setup", "NotFound")
    If $value <> "NotFound" Then
        Run($workdir & "\" & $value)

        $title="AVG"
        WinWait($title,"Welcome")
        ControlClick($title, "", 1000)

        WinWait($title,"Please read")
        ControlClick($title, "", 1000)

        WinWait($title,"Select Setup Type")
        ControlClick($title, "", 1000)

        WinWait($title,"Personalize")
        ControlClick($title, "", 1000)

        WinWait($title,"Destination folder")
        ControlClick($title, "", 1000)

        WinWait($title,"Component Selection")
        ControlClick($title, "", 1000)

        WinWait($title,"Installation Summary")
        ControlClick($title, "", 1000)
    EndIf
EndIf

It all still needs to be refined, but it already takes a lot of repetitive stuff off my hands. I hope it'll be useful for others as well.

Jo

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...