Solved

VBScript to uninstall

Posted on 2004-10-19
5
263 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 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

776 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