Solved

VBScript to uninstall

Posted on 2004-10-19
5
276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 …

749 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