Improve company productivity with a Business Account.Sign Up

x
?
Solved

VBScript to uninstall

Posted on 2004-10-19
5
Medium Priority
?
293 Views
Last Modified: 2010-04-17
We have anti-virus software deployed on client PC's throughout our building, and we are switching to a new anti-virus solution tomorrow.  In order to uninstall the client-side anti-virus utility, we have to 1) be logged in as 'administrator' and 2) enter a password when prompted by the anti-virus uninstall utility.  Can I write a script to do this?  Other alternative is manual uninstall on  about 150 PC's.

Thanks.  Please let me know if you have any questions.

IPT
0
Comment
Question by:iptrader
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:R_Janssen
ID: 12356783
With VBS is should be possible if you use FSO (File system object).
Though it has one downside... the current virus scanner might actually not let it start up.

Set fso = CreateObject("Scripting.FileSystemObject")
set wscr=CreateObject("WScript.Shell")

check = wscr.RegRead("HKEY_CURRENT_USER\Software\YourVirusScanner")

if (check>=1) then
 wscr.RegDelete "HKEY_CURRENT_USER\Software\YourVirusScanner")
end if

This EE link might give you some more info about FSO's
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20838104.html

If I had the time right now I would write it for you :)
0
 
LVL 5

Expert Comment

by:naiea1231
ID: 12356799
This is most definitely possible using vbscript, what exactly did you need it do?

Few options:
You can check your logged in as an admin quite easily, doesn't seem like you can run the uninstall completely remotely (due to the password prompt) but you can use sendkeys to automatically type the password in, as well as automatically launch the uninstall utility.

Is that the sort of thing your looking to do? Some specifics would be great.

James
0
 

Author Comment

by:iptrader
ID: 12357124
Hi James,

Basically, what I need to do is uninstall the anti-virus on the client PC's.  In order for that to happen, one has to be logged in as an administrator on that PC, and during the uninstall, the antivirus utility prompts for a password.  I've never written VBScript for stuff like this, so I can definitely use the help :).

Thanks,

IPT
0
 

Author Comment

by:iptrader
ID: 12359924
Any ideas?  Please?? :)
0
 
LVL 5

Accepted Solution

by:
naiea1231 earned 2000 total points
ID: 12369813
This is the sort of thing you'll probably be looking to code

Dim oShell
Set oShell = WScript.createObject("WScript.Shell")

oShell.Run "C:\Windows\system32\sol.exe"     'runs the application or in your case the uninstall utility
Wscript.Sleep 5000          'waits 5 seconds, 1000ms in a second so 5000
oShell.AppActivate("Solitaire")      'centres the window with the title "Solitaire
oShell.SendKeys("password")   'sends the keystrokes 'password' to that window

Set oShell = Nothing


Various combinations of the above should help you out there, if you need to do anything else let me know, you may want to add an if loop for detecting when the password box is waiting, keep in mind if you want to send keys like enter use {ENTER}, there should be lists of these special keys around the net, just do a bit of research into the sendkeys method.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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.

Join & Write a Comment

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Make the most of your online learning experience.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes

595 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question