We help IT Professionals succeed at work.

How do I automate uninstalling programs with executables(.exe) using vbscripting techniques?

Medium Priority
Last Modified: 2013-11-25
Currently I am using scripts with 'sendkey' commands to automate uninstalls of .exe's. OUCH, I know. I guess I need understanding of the challenges to automating uninstalls of executables that natively want user interaction.
Vbscript quiet uninstalls of .msi's has been straight forward but now I am in an environment with many old programs needing cleanup.

examples I have worked with:
this works for Adobe...  but obviously it is not an executable..
C:\WINDOWS\ISUNINST.EXE -a,-y,-f"C:\Program Files\Common Files\Adobe\Acrobat 5.0\NT\Uninst.isu" -c"C:\Program Files\Common Files\Adobe\Acrobat 5.0\NT\Uninst.dll"
some have suggested this...
WshShell.Run("CMD /C RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup" & " c:\progra~1\Instal~1\{E0000600-0600-0600-0600-000000000600}\Setup.exe" & " -l0x9" &  " -uninst")

Open in new window

Watch Question

Always if possible use the silent uninstalls.  You can get the uninstall command from the registry.

Each of the keys will have an UninstallString and value.  Some times that value does not have thecorrect silent switch, but if you go to appdeploy.com or google or others, you can find the proper switch.

Many times, if install shield, you will need to create an answer file.   That is done like so...
...with app installed...
setup.exe -r
remove the app when prompted
look for c:\windows\setup.iss

Take al this info and add it to your vbs the same way you do a msi.

Good luck.
Check out www.appdeploy.com


Thanks for your response. This info is helpful. I guess depending on how a developer packages their app, you need to try a few different techniques. Along these lines I probably should become more familiar with what the various ways to wrap an executable is and then figure some reverse engineering. Is their a way to do that? Reverse engineer an executable in hope of coming up with a silent uninstall if it originally does not support it? Also is it possible to create an msi out of an exe and than apply techniques to it that work for silent uninstalls for the msi?
I have used a product in the past called lduninst.exe.  It was created to be used with a product called LANDesk.

It is cool because, if there is silent uninstall information listed in the registry, then this product will try to uninstall it.

In addition, you can uninstall all versions of somethings with shortened names, for instance...
If I wanted to uninstall all version of Java using this tool, I simple run lduninst java* and all versions would be uninstalled.  If I only wanted to uninstall java 1.4_2, then I would run lduninst java 1.4_2

You might try searching google for it.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


tx for your replies, they were very helpful
good luck with everything.  As I said before appdeploy.com is a great place for silent install as well as uninstall information

take care.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.