Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 11-27-2008, 02:56 AM   #1 (permalink)
Osiris's Avatar
 

Join Date: Jan 2005

Location: Kentucky

Posts: 32,073

Osiris is a jewel in the roughOsiris is a jewel in the roughOsiris is a jewel in the rough

Send a message via ICQ to Osiris Send a message via AIM to Osiris Send a message via MSN to Osiris Send a message via Yahoo to Osiris Send a message via Skype™ to Osiris
Default Zango Removal Script

I created a script .VBS to remove Zango and Shopping Report. It first kills the processes I have in the applist, then deletes files, then subfolders up to the main folder. It works great but to delete Zango, I need to run it twice. It deletes some files but not all untill the next round. Any ideas?

appList = "iexplore.exe,Weather.exe,ZangoSA.exe,OEAddon. exe"
For Each app In Split(appList, ",")
Set objProcs=GetObject("winmgmts:\\.\root\cimv2").Exec Query("select * from Win32_Process where Name='" & app & "'")
For Each process In objProcs
process.Terminate
Next
Next

on error resume next
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\arrow.ico")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\CntntCntr.dll")


Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\copyright.txt")


Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\CoreSrv.dll")


Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\HostIE.dll")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\HostOE.dll")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\HostOL.dll")


Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\link.ico")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\OEAddOn.exe")


Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\Srv.exe")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\Toolbar.dll")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\Wallpaper.dll")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\Weather.exe")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\WeSkin.dll")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\ZangoSA")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\ZangoSADF.exe")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\ZangoSAHook.dll")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\ZangoUninstaller.exe")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\firefox\extensions\chrom e.manifest")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\firefox\extensions\insta ll.rdf")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\firefox\extensions\compo nents\npclntax.xpt")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\Zango\bin\10.3.75.0\firefox\extensions\plugi ns\npclntax_ZangoSA.dll")

Dim FSO, Folder
set FSO=CreateObject("Scripting.FileSystemObject")

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\ShoppingReport\Uninst.exe")
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("C:\Program Files\ShoppingReport\Bin\2.5.0\ShoppingReport.dll" )

Folder="C:\Program Files\ShoppingReport\Bin"
FSO.DeleteFolder(Folder)

Folder="C:\Program Files\ShoppingReport"
FSO.DeleteFolder(Folder)
Folder="C:\Program Files\Zango\bin\10.3.75.0"
FSO.DeleteFolder(Folder)
Folder="C:\Program Files\Zango\bin"
FSO.DeleteFolder(Folder)
Folder="C:\Program Files\Zango"
FSO.DeleteFolder(Folder)
Folder="C:\Program Files\Zango\bin\10.3.75.0"
FSO.DeleteFolder(Folder)
Folder="C:\Program Files\Zango\bin"
FSO.DeleteFolder(Folder)
Folder="C:\Program Files\Zango"
FSO.DeleteFolder(Folder)
__________________
Osiris is online now  
Old 11-27-2008, 11:45 AM   #2 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,410

office politics will become famous soon enough

Default Re: Zango Removal Script

all the repeat lines of

Set objFSO = CreateObject("Scripting.FileSystemObject")

are unnecessary. once you set it, it remains until you set to something else.



i would comment out on error resume next and run the script. my guess is that it would error out saying something like file locked. if you fix this, you prolly won't have to do two passes.


regardless, to make a second pass, you can create a for next loop

before the first delete, insert the following line

for i = 0 to 2


then after the last delete, insert the following line

next



this says im creating a variable i and setting it to zero. I'm going to run all the code until I find the "next" statement. Then, I'm going to increment the i variable and evaluate the expression i = 2. if true, i'll run the code after the "next" statement.


VBScript » Statements » For - DevGuru Quick Reference
office politics is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
controlling "change owner to" drop box list in windows using script for a file sangeeta_shetty Windows Operating Systems and Software 0 06-17-2008 05:29 AM
A shutdown script Nick Windows Operating Systems and Software 3 01-30-2008 03:58 PM