[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 754
  • Last Modified:

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

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.

tx
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

0
geewizzz
Asked:
geewizzz
  • 3
  • 2
1 Solution
 
MiahmichnoCommented:
geewizzz,
Always if possible use the silent uninstalls.  You can get the uninstall command from the registry.
HKLM\Software\microsoft\windows\currentversion\uninstall\<whatever>

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
0
 
geewizzzAuthor Commented:
Miahmichno:
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?
0
 
MiahmichnoCommented:
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.
0
 
geewizzzAuthor Commented:
tx for your replies, they were very helpful
0
 
MiahmichnoCommented:
good luck with everything.  As I said before appdeploy.com is a great place for silent install as well as uninstall information

take care.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now