VBScript to uninstall

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
iptraderAsked:
Who is Participating?
 
naiea1231Connect With a Mentor Commented:
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
 
R_JanssenCommented:
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
 
naiea1231Commented:
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
 
iptraderAuthor Commented:
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
 
iptraderAuthor Commented:
Any ideas?  Please?? :)
0
All Courses

From novice to tech pro — start learning today.