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

Posted on 2009-02-09
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

Question by:geewizzz
    LVL 1

    Expert Comment

    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 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

    Author Comment

    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?
    LVL 1

    Accepted Solution

    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.

    Author Closing Comment

    tx for your replies, they were very helpful
    LVL 1

    Expert Comment

    good luck with everything.  As I said before is a great place for silent install as well as uninstall information

    take care.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…

    728 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

    21 Experts available now in Live!

    Get 1:1 Help Now