All things SMS, System Center Configuration Manager, Active Directory, Group Policy, Virtualization, Security, Gadgets, Technology, and the Daily Thoughts of an SMS Engineer named Anthony Clendenen.

The Daily Ramblings of an SMS Engineer

VBScript to Remove Old Versions of IXOS and SAP and Install New Versions

April 22, 2006

This is a script I put together to remove old versions IXOS and SAP and install the new versions.  This has not been fully tested and I have altered it since I did my testing so use this AT YOUR OWN RISK.  Make sure you modify it and test it throughly before using it.  I cannot be held liable for any results, this is provided as is and only as a guide to help make a similar script for your own purposes.

Make sure you watch the word wrap done during the posting or better, just get the attachment and edit it.

You can leave comments with any questions or email me.

'==========================================================================
'
' VBScript Source File -- Created with SAPIEN Technologies PrimalScript 4.0
'
' NAME: SAPUpgrade.vbs
'
' AUTHOR: Anthony Clendenen
' DATE  : 4/18/2006
'
' COMMENT: PROVIDED AS IS - NO WARRANTY - I CANNOT BE HELD LIABLE 'FOR ANY PROBLEMS!
' Remove IXOS C:\WINDOWS\IsUninst.exe -c"C:\IXOS-eCONtext\UNINST.dll" -'f"C:\WINDOWS\IXUninst.isu"
' Delete registry keys and subkeys - HKLM\Software\IXOS & HKCU\Software\IXOS
' Uninstall SAP - Installation server>\Netinst\ 'SAPSWEEP /all /y /nocancel /delsubdirs /delregkeys
' Install SAP v640 - \\server\share\setup\SapSetup.exe /p:"pkgname" /install /noDialog /silent
' Install IXOS 51D - \\servername\SAP_IXOS\51D\STOP.exe 'SILENTFILE="servershare\SAP_IXOS\51D\Win32Cln\installDesktopLink.ini" 'ALLUSERS=1 /qb
'==========================================================================
On Error Resume Next

Dim sComputer, sIxosKey1, sIxosKey2, oFSO, oWMIService, SWBemlocator, oShell Dim strOSVersion
Dim sWinFolder, oEnvVar, SMServer, sPkgName, sServerShare

Set oShell = CreateObject("Wscript.shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set SWBemlocator = CreateObject("WbemScripting.SWbemLocator")
Set oWMIService = SWBemlocator.ConnectServer(sComputer,"\root\CIMV2")

SMServer = <\\server name>
sPkgName = "Name Here"
sServerShare = <\\servershare>

If oFSO.FolderExists("C:\Windows") = -1 Then
oShell.Run("C:\WINDOWS\IsUninst.exe -c" & "C:\IXOS-eCONtext\UNINST.dll -f" & _ "C:\WINDOWS\IXUninst.isu -a"),1,True 'Uninstall old version of IXOS
Else
If oFSO.FolderExists("C:\Winnt") = -1 Then
oShell.Run("C:\Winnt\IsUninst.exe -c" & "C:\IXOS-eCONtext\UNINST.dll -f" & _ "C:\Winnt\IXUninst.isu -a"),1,True 'Uninstall old version of IXOS
 Else 
MsgBox ("Cannot determine Windows directory.")
WScript.Quit
End If
End If

oShell.Run("C:\WINDOWS\IsUninst.exe -c" & "C:\IXOS-eCONtext\UNINST.dll" & _    "-f" & "C:\WINDOWS\IXUninst.isu /qn"),1,True 'Uninstall old version of IXOS
oShell.Run "reg DELETE HKLM\SOFTWARE\IXOS /f",1,True
oShell.Run "reg DELETE HKCU\SOFTWARE\IXOS /f",1,True

oShell.run(SMServer & "\640 _ \setup\SAPSWEEP.exe /all /y /nocancel /delsubdirs /delregkeys"),1,True   'Remove SAP
oShell.run(SMServer & "\640\setup\SapSetup.exe /p:" & sPkgName _                               & " /install /noDialog /silent"),1,True 'Install new SAP
'Windows 2000 ONLY: In REGEDIT, set HKEY_Current_User\Control 'Panel\Desktop\foregoundlocktimeout = 0
getOS()
 if getOS = "2000WRK" or getOS = "2000SRV" Then
  oShell.RegWrite"HKEY_CURRENT_USER\Control" & " " _ &  "Panel\Desktop\foregroundlocktimeout", "0"
 End If
oShell.run(SMServer & "\51D\STOP.exe SILENTFILE=" & sServerShare _                     & "\SAP_IXOS\51D\Win32Cln\installDesktopLink.ini" & "ALLUSERS=1 /qb"),1,True 'Install new version of IXOS
' ********************************************************************************
'Get OS Function
'********************************************************************************
Function getOS()
For Each objOS in GetObject("winmgmts:").InstancesOf ("Win32_OperatingSystem")
 if objOS.Caption = "Microsoft Windows XP Professional" Then sOS =  "XP" Else
 if objOS.Caption = "Microsoft Windows 2000 Professional" Then sOS =  "2000WRK" Else
 if objOS.Caption = "Microsoft Windows 2000 Server" Then sOS =  "2000SRV" Else
 If (InStr(1,objOS.Caption, "2003", 1)) Then sOS =  "2003" Else
 If objOS.Caption = "Microsoft Windows NT Workstation" Then sOS =  "NT4WRK" Else
 If objOS.Caption = "Microsoft Windown NT Server" Then sOS =  "NT4SRV" Else
 If objOS.Caption = "Microsoft Windows NT Server, Terminal Server" Then sOS_            =  "NT4TS" Else
 sSP = "SP" & objOS.ServicePackMajorVersion
Next

If sSP = "SP0" Then sSP = ""

'sOS = sOS & sSP
'getOS = sOS
strOSVersion = getOS
End Function

Comments

  • No Comments