SCCM TS VB Script to Uninstall applications

Recently have a requirement to uninstall all old adobe versions and install the new on.Looking for something which can be done Via but i found the below method is simple that can remove all the older applications and instal the new one(which can be done Via TS by adding two TS actions one with removal of old adobe versions and other for installation of New adobe).

Thought of sharing with you here how to remove different versions of applications at one go. Thanks to john Marcum for providing me the command line.

Here is the simple script that checks if the application is in use or not ,if app is opened ,it will terminate and start the uninstallation .

On Error Resume Next

 Dim WshShell

Set objHOST = CreateObject("WScript.Shell")

 strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colProcessList = objWMIService.ExecQuery _

    ("Select * from Win32_Process Where Name = 'acroRd32.exe'")

For Each objProcess in colProcessList

    objProcess.Terminate()

    Exit For

Next

 Set WshShell= CreateObject("Wscript.Shell")

WshShell.Run "msiexec /x {AC76BA86-7AD7-1033-7B44-A94000000001} /qn /norestart",0,true

WshShell.Run "msiexec /x {AC76BA86-7AD7-FFFF-7B44-AA0000000002} /qn /norestart",0,true

WshShell.Run "msiexec /x {AC76BA86-7AD7-FFFF-7B45-AA0000000002} /qn /norestart",0,true

If you have multiple versions with different product ID for removal,add all the product ID's at the end of the above code you know what i mean.

One Response to "SCCM TS VB Script to Uninstall applications"

Leave a Reply