narillo 0 Report post Posted November 12, 2008 hi guys... i need your help please... i'm try to use this script to automate daemont tools 4.30.1 and remove the daemon tool bar, etc... but it doesn't work properly... what i'm doing wrong?? thanks a million in advance for your help guys.. expandcollapse popup#cs AutoIt 3.2 Script slightly based on an old Daemon Tools 4.0 script published at the MSFN.org boards. Author: Guillermo Miranda Alamo #ce ; Installer. $Name = "DAEMON Tools" $executable = 'daemon4301.exe' ; Default category folder in startmenu. $group = 'Recorder\Daemon Tools' ; Installation folder in Program Files. $directory = 'Recorder\Daemon Tools' ; Run the installer. RunWait($executable & " /S /D=" & @ProgramFilesDir & "\" & $directory,@ScriptDir) _Desktop('DAEMON Tools.lnk') ; Delete spyware installer. RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","DaemonTools_WhenUSave_Installer") If FileExists(@ProgramFilesDir & '\' & $directory & '\SetupDTSB.exe') Then FileDelete(@ProgramFilesDir & '\' & $directory & '\SetupDTSB.exe') EndIf ; Kill the spyware process If ProcessExists("DaemonTools_WhenUSave_Installer.exe") Then ProcessClose("DaemonTools_WhenUSave_Installer.exe") EndIf ; Remove that... Crap DirRemove(@ProgramFilesDir & '\' & "DaemonTools_WhenUSave_Installer",1) ; Move program menu folder DirMove ( @ProgramsCommonDir&"\"&$Name, @ProgramsCommonDir&"\"&$group , 1 ) Exit Func _Desktop($shortcut) ; Delete a Desktop shortcut. If FileExists(@DesktopDir & '\' & $shortcut) Then Return FileChangeDir(@DesktopDir) And FileDelete($shortcut) ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then Return FileChangeDir(@DesktopCommonDir) And FileDelete($shortcut) EndIf EndFunc Share this post Link to post Share on other sites
enaiman 14 Report post Posted November 12, 2008 Welcome to the forum. I don't have Daemon Tools and I don't have any need for it, so the help I'll be able to give you will be under these conditions. Your _Desktop function looks a little weird to me - especially "Return" statements. Func _Desktop($shortcut) ; Delete a Desktop shortcut. If FileExists(@DesktopDir & '\' & $shortcut) Then Return FileChangeDir(@DesktopDir) And FileDelete($shortcut) ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then Return FileChangeDir(@DesktopCommonDir) And FileDelete($shortcut) EndIf EndFunc "Return" statement is used usually to pass something back OR to force a return before the function execution comes to a natural end. In your case "Return" is not justified. Your function should be: Func _Desktop($shortcut) ; Delete a Desktop shortcut. If FileExists(@DesktopDir & '\' & $shortcut) Then FileChangeDir(@DesktopDir) FileDelete($shortcut) ElseIf FileExists(@DesktopCommonDir & '\' & $shortcut) Then FileChangeDir(@DesktopCommonDir) FileDelete($shortcut) EndIf EndFunc SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example scriptwannabe "Unbeatable" Tic-Tac-ToePaper-Scissor-Rock ... try to beat it anyway :) Share this post Link to post Share on other sites
LarryDalooza 37 Report post Posted November 12, 2008 I think he does that to consolidate the return values of the individual functions into his own return value as boolean... It is functionally OKEY DOKEY. Lar. AutoIt has helped make me wealthy Share this post Link to post Share on other sites