uninstall script

Hi;
This script below creates an error that says cannot find the path. The error says its about the row 15. Can someone help me about this. I need to uninstall nod32 antivirus from my network computers.


const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
 strComputer & "\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NOD32"
strValueName = "UninstallString"

oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strUninstallFullPath

' the following line -y switch suppresses the confirmation question from poping up
strUninstallFullPath=strUninstallFullPath & " -y"

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run strUninstallFullPath,8,true
set WshShell=nothing
burcayarogluAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sramesh2kCommented:
Hi burcayaroglu,

See if enclosing the uninstall string (command-line) within double-quotes helps.

Example:

Use:
"C:\Program Files\NOD\Uninstall.exe" -y

instead of

C:\Program Files\NOD\Uninstall.exe -y

Perhaps that'll help you circumwent the LFN problems.
0
burcayarogluAuthor Commented:
Thanks for your response however the uninstall string in the registry is
C:\Program Files\Eset\Setup\setup.exe /UNINSTALL and the error says it can not find the path. Is there another way of writing this script ?
0
sramesh2kCommented:
See if this helps:

- - -
Set WshShell = CreateObject("Wscript.Shell")
strUninstallFullPath= Chr(34) & WshShell.ExpandEnvironmentStrings("%ProgramFiles%")
strUninstallFullPath= strUninstallFullPath & "\Eset\Setup\setup.exe" & Chr(34) & " /UNINSTALL"
WshShell.Run strUninstallFullPath,8,True
Set WshShell=nothing

- - -
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

burcayarogluAuthor Commented:
Thats actually started the uninstall. Thank you very much. The points are yours. However I have a new problem now. Is there a way to start this uninstall in silent mode ? Its asking user confirmation.
0
sramesh2kCommented:
>> Is there a way to start this uninstall in silent mode ?

Not that I know of. Usually the concerned application is responsible for supplying the quiet uninstall string. See if there is a QuietUninstallString value in the same registry key you checked earlier. If not, I'm sorry there is no way to do a silent uninstall.
0
burcayarogluAuthor Commented:
it says /SLIENTMODE to start in silent mode. I can not figure out how write this command. I mean /UNISTALL and /SLIENTMODE together. I am a little confused
0
sramesh2kCommented:
Try:

- - -
Set WshShell = CreateObject("Wscript.Shell")
strUninstallFullPath= Chr(34) & WshShell.ExpandEnvironmentStrings("%ProgramFiles%")
strUninstallFullPath= strUninstallFullPath & "\Eset\Setup\setup.exe" & Chr(34)
strUninstallFullPath= strUninstallFullPath & " /UNINSTALL /SILENTMODE"
WshShell.Run strUninstallFullPath,8,True
Set WshShell=nothing

- - -
0
burcayarogluAuthor Commented:
Its done Thank you very much !
0
sramesh2kCommented:
I'm glad that helped!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows XP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.