Spent some time on this..
What do you think of this?
Thanks go out to Doc on this..
code:
;Well...
;Kinda close..
;I am getting the following error message
;C:\Program Files\Gator.com\OFFERC~1 - The process cannot access the file because
; it is being used by another process.
; -- Author: Kent Dyer
; -- Date: 13 June 2002
; -- Thanks DOC for the inspiration!
; -- Ref. - http://kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=003427
BREAK ON
CLS
;Block Gator
;REF - http://www.winguides.com/registry/display.php/1014/
$Domainblock = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains"
IF 1 <> keyexist($Domainblock+"\gator.com")
$RC = addkey($Domainblock+"\gator.com")
$RC = writevalue($Domainblock+"\gator.com","*",4,"REG_DWORD")
$RC = addkey($Domainblock+"\gatoradvertisinginformationnetwork.com")
$RC = writevalue($Domainblock+"\www.gatoradvertisinginformationnetwork.com","*",4,"REG_DWORD")
$RC = addkey($Domainblock+"\www.offercompanion.com")
$RC = writevalue($Domainblock+"\www.offercompanion.com","*",4,"REG_DWORD")
ENDIF
IF 1 = keyexist("HKLM\SOFTWARE\Gator.com")
;Process - GATOR.EXE
;Process - CMESys.exe
;Process - GMT.exe
;First, we want to terminate Gator and related apps
$gator = "GATOR.EXE"
$cmesys = "CMESys.exe"
$gmt = "GMT.exe"
$appl = Split("$GATOR~~$CMESYS~~$GMT", "~~")
;FOR EACH $element IN $appl
; FOR EACH $process IN GetObject("winmgmts:{impersonationLevel=impersonate}").execquery("select * from Win32_Process where Name='$appl'")
; $rc = $process.terminate
; NEXT
;NEXT
FOR EACH $process IN GetObject("winmgmts:{impersonationLevel=impersonate}").execquery("select * from Win32_Process where Name='$gator'")
$rc = $process.terminate
NEXT
;--
FOR EACH $process IN GetObject("winmgmts:{impersonationLevel=impersonate}").execquery("select * from Win32_Process where Name='$cmesys'")
$rc = $process.terminate
NEXT
;--
FOR EACH $process IN GetObject("winmgmts:{impersonationLevel=impersonate}").execquery("select * from Win32_Process where Name='$gmt'")
$rc = $process.terminate
NEXT
;Let's remove some folders
$gmt = Readvalue("HKLM\SOFTWARE\Gator.com\Gator\dyn","AppPath")
$cmesysii = Readvalue("HKLM\SOFTWARE\Gator.com\CMEII","AppPath")
?$cmesysii ; -- Current path..
;Let's do some trimming
$lcmesysii = Len($cmesysii) ; - Length of AppPath
;$Lcmesysii + " Length of AppPath"
$lcmesys = Len($cmesys) ; -- Length of CMESys.exe
;?$Lcmesys + " Length of CMESys.exe"
$nlen = $lcmesysii - $lcmesys
;$nlen + " New length"
$cmesysiipath= SUBSTR( $cmesysii, 1, $nlen-1 )
;?$cmesysiipath
;Find Gator on the system
$gator = Readvalue("HKLM\SOFTWARE\Gator.com\AppInfo\Gator","lockfiles")
;C:\Program Files\Gator.com\Gator\Gator.exe
$offset = INSTR( $gator, ".com" ) ;Determine position
?$offset
$gatorpath= SUBSTR( $gator, 1, $offset+3 )
?$gatorpath
$gatorpath = "C:\Program Files\Gator.com"
;Determine path to Start menu
; I know this different for Win9x..
$startmenu = READVALUE("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common Programs")
;C:\Documents and Settings\All Users\Start Menu\Programs\GAIN
;C:\Documents and Settings\All Users\Start Menu\Programs\Gator eWallet
;C:\Documents and Settings\All Users\Start Menu\Programs\OfferCompanion
; -- Take the Read-only attributes off the directories
;;$RC = SETFileAttr("$Startmenu\GAIN\",128)
;;?$RC
;;$RC= SETFileAttr("$Startmenu\Gator eWallet\",128)
;;?$RC
;;$RC= SETFileAttr("$Startmenu\OfferCompanion\",128)
;;?$RC
;gETS $K
IF @inwin=1
; -- Pull the read-only flags from the folders
;$attrgator=SHELL'%comspec% /c ATTRIB -R $gatorpath /S /D '
;$attrgmt=SHELL'%comspec% /c ATTRIB -R $gmt /S /D '
;$attrcmesysii=SHELL'%comspec% /c ATTRIB -R $cmesysiipath /S /D '
;$attrgain=SHELL'%comspec% /c ATTRIB -R $Startmenu\GAIN /S /D '
;$attrewallet=SHELL'%comspec% /c ATTRIB -R $Startmenu\Gator eWallet /S /D '
;$attroffer=SHELL'%comspec% /c ATTRIB -R $Startmenu\OfferCompanion /S /D '
SHELL '%comspec% /c RD /S /Q "$gatorpath"'
SHELL '%comspec% /c RD /S /Q "$gmt"'
SHELL '%comspec% /c RD /S /Q "$cmesysiipath"'
SHELL '%comspec% /c RD /S /Q "$Startmenu\GAIN"'
SHELL '%comspec% /c RD /S /Q "$Startmenu\Gator eWallet"'
SHELL '%comspec% /c RD /S /Q "$Startmenu\OfferCompanion"'
ELSE
SHELL '%comspec% /c %WINDIR%\COMMAND\DELTREE /Y $gatorpath'
SHELL '%comspec% /c %WINDIR%\COMMAND\DELTREE /Y $gmt'
SHELL '%comspec% /c %WINDIR%\COMMAND\DELTREE /Y $cmesysiipath'
SHELL'%comspec% /c %WINDIR%\COMMAND\DELTREE /Y $Startmenu\GAIN'
SHELL'%comspec% /c %WINDIR%\COMMAND\DELTREE /Y $Startmenu\Gator eWallet'
SHELL'%comspec% /c %WINDIR%\COMMAND\DELTREE /Y $Startmenu\OfferCompanion'
ENDIF
;Let's remove Keys from the registry
$rc = DELTREE("HKLM\SOFTWARE\Gator.com")
$rc = DELTREE("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{456BA350-947F-4406-B091-AA1C6678EBE7}")
$rc = DELTREE("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6C8DBEC0-8052-11d5-A9D5-00500413153C}")
$index = 0
:loop1
$keyname = ENUMKEY("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ModuleUsage\", $index)
IF @error = 0
; ? "Name found: $KeyName"
IF instr($keyname,"gator")
$rc = DELTREE($keyname)
ENDIF
$index = $index + 1
GOTO Loop1
ENDIF
;;$RC = DELTREE("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ModuleUsage\C:/WINDOWS/Downloaded Program Files/IEGator.dll\.Owner")
?"Process is complete"
RETURN
ELSE
RETURN ; -- Gator does not exist or has been removed
ENDIF
Thanks,
Kent
[ 13 June 2002, 20:41: Message edited by: kdyer ]