Trying to uninstall 2 apps with 1x .vbs script...

It is uninstalling one of the applications that i want to uninstall, but not the other.......its not to do with the uninstall string ( if i swap over the strings then it uninstalls the other app fine but again......its not doing both of the uninstalls ).
Can anyone spot what im misisng in my script?

Option Explicit
On Error Resume Next
Dim oShell, sUninstallString
Set oShell = CreateObject("WScript.Shell")

Const UNINSTALLPATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
Const PRODCODE = "InstallShield_{8D3D93DA-B0C4-4C56-8FB9-67CB050EB15D}"
Const PRODCODE2 ="{6257E290-5E8E-11D4-9B8D-00D0B72459DD}"
Const PACKAGE = "Setup.exe"


Set oShell = Nothing

'Check for existance of Rits Client and if present uninstall it.
Sub Uninstall()
On Error Resume Next

sUninstallString = oShell.RegRead (UNINSTALLPATH & PRODCODE & "\UninstallString")
If err.number = 0 Then
oShell.Run "C:\Program Files\Common Files\InstallShield\Driver\8\Intel 32\IDriver.exe" & """/M{8D3D93DA-B0C4-4C56-8FB9-67CB050EB15D}""", 0,True
End If
sUninstallString = ""

sUninstallString = oShell.RegRead (UNINSTALLPATH & PRODCODE2 & "\UninstallString")
If err.number = 0 Then
oShell.Run "RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\engine\6\INTEL3~1\Ctor.dll,LaunchSetup " & """C:\Program Files\InstallShield Installation Information\{6257E290-5E8E-11D4-9B8D-00D0B72459DD}\Setup.exe""" & " UNINST /S /f1""C:\Packages\RitsClient\uninst.iss""", 0,True
End If

End Sub

0 Comments   [ + ] Show comments

Answers (3)

Posted by: AngelD 14 years ago
Red Belt
Try use shell instead of run.

Run: does not wait for the program to complete. Script execution continues immediately.
Shell: Script execution is stopped until the program exits.
Posted by: dbowe 14 years ago
Orange Belt
So just swap the oshell.run with oshell.shell?
Posted by: AngelD 14 years ago
Red Belt
Hi dbowe,

hmmm thought you wrote kix ... didn't see the it was vbscript first so skip my comment on shell.

I may be due to that the main process spawns a child process and then drops but the child process is still running and interfere with the next executed process even if bWaitOnReturn is set to True. You may need to launch this in another way and check if the child process also has finished it's execution.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ