Uninstall old client and install new client script

etchingsj

ADSM.ORG Member
Joined
Feb 5, 2008
Messages
242
Reaction score
7
Points
0
Location
Lost Wages NV
I did a quick search but could not find exactly what we need.
Does anyone have a VB or powershell script to remove an older 5x client and the services and install a newer one?

So I have something like this:


Const AppName = "IBM Tivoli Storage Manager Client"
'Const AppName = "IBM Tivoli Storage Manager for Databases - MS SQL"
'IBM Tivoli Storage Manager Client
'**********************************************************************
const HKEY_LOCAL_MACHINE = &H80000002
Set WshShell = WScript.CreateObject("WScript.Shell")
'First, find the GUID
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeysInstalledAppName = ""
InstalledAppName = WshShell.RegRead("HKLM\" & strKeyPath & "\" & subkey & "\DisplayName")
If InStr(InstalledAppName, AppName) > 0 ThenRawGUID = ""
GUID = ""
RawGUID = WshShell.RegRead("HKLM\" & strKeyPath & "\" & subkey & "\UninstallString")
GUID = Mid(RawGUID, instr(RawGUID, "{"), 38)
If GUID<>"" Then' Found matching GUID, removing...
WshShell.Run "msiexec /x " & GUID & " /qb"
Exit For
End If
End If
Next



Anyone have something they have used?
Thanks in advance,
 
Back
Top