By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,423 Members | 1,601 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,423 IT Pros & Developers. It's quick & easy.

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

P: 1
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\Cur rentVersion\Uninstall\"
Const PRODCODE = "InstallShield_{8D3D93DA-B0C4-4C56-8FB9-67CB050EB15D}"
Const PRODCODE2 ="{6257E290-5E8E-11D4-9B8D-00D0B72459DD}"
Const PACKAGE = "Setup.exe"

Uninstall
Install

Set oShell = Nothing
WScript.Quit

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

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\Ct or.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
Sep 5 '06 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.