Link to home
Start Free TrialLog in
Avatar of RicohIT
RicohIT

asked on

VB script to uninstall with admin rights.

The title says it all. I urgently need a VB script that would uninstall a software when executed, and obiviously it should have the admin rights so it can execute this process. Software im planing to uninstall is WebEx. This vbs will be sent to over 50 users thru e-mail so they can click it and run this to uninstall webex, and reason why i want the admin rights is because users have different rights. Some dont have uninstall rights. Thanks
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image


> This vbs will be sent to over 50 users thru e-mail

Your e-mail system and / or anti-virus software will squelch it. Remember the "I Love You" virus, a vbscript based virus distributed by e-mail?

I urge you to find a different way, perhaps remotely execute something against their systems to do what you want (whether that's using PsExec or some other method).

Chris
Avatar of RicohIT
RicohIT

ASKER

could you throw a little bit more light on usage of PsExec?
Is it installed in the same folder on each workstation?

If so, please give me an uninstall string from regedit, please?

run regedit.exe on workstation which has this software.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

and find key for WebEx software and give me UninstallString or QuietUninstallString (this one is better)

Thank you in advance.
Avatar of RicohIT

ASKER

If i right click on uninstall button on Webex, it has the following string to be runned. C:\Windows\System32\msiexec.exe /x{489AAD0D-19B8-414E-ABBD-267F30297FCB}
ASKER CERTIFIED SOLUTION
Avatar of ThinkPaper
ThinkPaper
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The solution depends on several things.
Are these people remote or do you have network access to their PC?  If remote, you're better off putting the file out on a web site not e-mail as it will be blocked (stated above).
If they are on your network, then psexec will work.
You don't really need VBS per se: a batch file would work just as well.  Example:;
MsiExec.exe /norestart /q/x {3248E093-5288-4CA9-B3AB-11A675FEA1F9} REMOVE=ALL
That would remove Symantec AV version 10.0.1.1000
Avatar of RicohIT

ASKER

thanks for the help. I already have the psexec on my computer. Regarding computerlist, am i suppose to add all the computersname into a txt file and copy it to the path where psexec is?


right now im testing wheter the command works locally, im pretty sure it will, but when using Psexec, what happens to the admin rights? will this execute even though some users dont have admin rights?
Avatar of RicohIT

ASKER

AleinSS: bat file wont work as users have different rights, some dont have admin rights, and with bat file, u cant realy have it run with admin rights.
OK, so, you should create a BAT file with uninstall string and place it in GPO in Computer section. Link it to proper OU and you will unistall software or use PSEXEC from SysInternals tools.

It would solve your problem.

If yod need assist, just let me know.
A batch file will work if you run it under admin rights, either with an encrypted runas solution or PSEXEC.
The easiest way to run something as "superuser" with PSEXEC is to use the "-s" option.

The computer list just a listing of computer names in plaintext:
computer1
computer2
computer3
Avatar of RicohIT

ASKER

Ur simply genious, it worked like a charm. Thanks alot.