Klaatu Posted March 16, 2005 Share Posted March 16, 2005 I came up with this when the President of the company asked for an easy way to help get rid of spyware from his home PC. It will install (silently) and run (silently) Spybot S&D if not already installed, or just run it (silently) if its already installed. All that's needed is to download Spybot's install file to where the script is and compile it. Then give the resulting .exe to the boss. expandcollapse popupGlobal Const $ProgramName = 'Spybot - Search & Destroy' Global $Program = @ProgramFilesDir & '\' & $ProgramName & '\' & 'SpybotSD.exe' Main() Exit Func Main() If Not @Compiled Then Opt ("TrayIconDebug", 1) EndIf If Not FileExists($Program) Then InstallSpybot() EndIf RunSpybot() EndFunc ;==>Main Func InstallSpybot() Local $TempInstall = TempFile('.exe') Local $DesktopIcon = @DesktopDir & '\' & $ProgramName & '.lnk' TrayTip(@ScriptName, 'Installing ' & $ProgramName, 1) FileInstall("spybotsd13.exe", $TempInstall) RunWait(Quote($TempInstall) & ' /verysilent /nocancel /components="main"') Sleep(2000) FileDelete($TempInstall) If FileExists($DesktopIcon) Then FileDelete($DesktopIcon) EndIf RunSilent() TrayTip(@ScriptName, 'Done installing ' & $ProgramName, 1) Sleep(2000) EndFunc ;==>InstallSpybot Func RunSpybot() TrayTip(@ScriptName, 'Running ' & $ProgramName, 1) RunSilent() TrayTip(@ScriptName, 'Done running ' & $ProgramName, 1) Sleep(3000) EndFunc ;==>RunSpybot Func RunSilent() RunWait(Quote($Program) & ' /autoupdate /autocheck /autofix /autoclose /autoimmunize /taskbarhide') EndFunc ;==>RunSilent Func TempFile($Ext = 'tmp') Local $TempName If StringLeft($Ext, 1) <> '.' Then $Ext = '.' & $Ext EndIf Do $TempName = "~" While StringLen($TempName) < 8 $TempName = $TempName & Chr(Round(Random(97, 122), 0)) Wend $TempName = @TempDir & "\" & $TempName & $Ext Until Not FileExists($TempName) Return ($TempName) EndFunc ;==>TempFile Func Quote($TheString, $QuoteChar = '"') Return ($QuoteChar & $TheString & $QuoteChar) EndFunc ;==>Quote My Projects:DebugIt - Debug your AutoIt scripts with DebugIt! Link to comment Share on other sites More sharing options...
steveR Posted March 16, 2005 Share Posted March 16, 2005 You might be due for a raise! AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
automagician Posted March 16, 2005 Share Posted March 16, 2005 Very cool!! Link to comment Share on other sites More sharing options...
buzz44 Posted March 17, 2005 Share Posted March 17, 2005 wat about if they installed spybot in a different folder eg. c:\spybot\ ? qq Link to comment Share on other sites More sharing options...
Insolence Posted March 17, 2005 Share Posted March 17, 2005 You could probably read the path from the registry. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar. Link to comment Share on other sites More sharing options...
Alterego Posted March 17, 2005 Share Posted March 17, 2005 awesome. i'd suggest setting the processor priority for the task to below normal. that way it interferes the least. (im a big fan of surfing the web while giving my cpu a workout ) This dynamic web page is powered by AutoIt 3. Link to comment Share on other sites More sharing options...
Klaatu Posted March 17, 2005 Author Share Posted March 17, 2005 wat about if they installed spybot in a different folder eg.c:\spybot\?<{POST_SNAPBACK}>Then Spybot would get installed again, into the default folder, presumably. But the boss does not have Spybot installed already, so no worries. My Projects:DebugIt - Debug your AutoIt scripts with DebugIt! Link to comment Share on other sites More sharing options...
sarkar112 Posted March 17, 2005 Share Posted March 17, 2005 I cant understand the function "fileinstall", where do u get spybotdl3.exe? Link to comment Share on other sites More sharing options...
Klaatu Posted March 18, 2005 Author Share Posted March 18, 2005 I cant understand the function "fileinstall", where do u get spybotdl3.exe?<{POST_SNAPBACK}>For FileInstall function documentation, see AutoIt3's help file.You can get spybot13.exe from http://www.safer-networking.org/en/index.htmlHTH My Projects:DebugIt - Debug your AutoIt scripts with DebugIt! Link to comment Share on other sites More sharing options...
sarkar112 Posted March 19, 2005 Share Posted March 19, 2005 i still dont get it is it just like a move func or copy func or something? Link to comment Share on other sites More sharing options...
Owen Posted March 20, 2005 Share Posted March 20, 2005 In a script, its exactly like FileCopy When compiled, the file is placed inside the EXE Link to comment Share on other sites More sharing options...
BasicOs Posted March 20, 2005 Share Posted March 20, 2005 Great I enjoyed Autoit.es - Foro Autoit en EspaƱol Word visitors Image Clustrmap image: - Football Spanish team - Spanish team: Casillas, Iniesta, Villa, Xavi, Puyol, Campdevilla, etc..Programando en Autoit+Html - Coding Autoit-Html - Arranca programas desde Internet - Preprocesador de Autoit a http Link to comment Share on other sites More sharing options...
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