Solved

VBScript to uninstall

Posted on 2004-10-19
5
243 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Any ideas?  Please?? :)
0
 
LVL 5

Accepted Solution

by:
naiea1231 earned 500 total points
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now