The script i have is as follows:
Option Explicit 'all variables must be defined Dim oReg, oShell, oFSO Dim UninstallString, ProductCode Dim strComputer, colItems, objWMIService, objItem Dim strKeyPath, subkey, arrSubKeys strComputer = "." '******************************** 'Enter Product Code Of The Application Here That You Want To Uninstall within the Bracket ProductCode = "{AC76BA86-1033-0000-7760-000000000004}" '******************************** ' Get scripting objects needed throughout script. Set oShell = CreateObject("WScript.Shell") '************************** UninstallString = "MsiExec.exe /X" & ProductCode & " /qn" & " /norestart" Const HKEY_LOCAL_MACHINE = &H80000002 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys For Each subkey In arrSubKeys IF subkey = ProductCode Then oShell.Run UninstallString, 1, True End If Next Set oShell = Nothing Set oReg = Nothing '************* End Code ************
The script is a VBS (.vbs) script, The thing i'm having problems with is locating commonly removed programs (Limewire etc) and thier respective GUIDs, If a program does not have a GUID, i have this script as a fallback:
strApplicationName = "Name of Software Here" strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSoftware = objWMIService.ExecQuery("Select * From Win32_Product Where Name = '" & strApplicationName & "'") For Each objSoftware in colSoftware objSoftware.Uninstall() Next
Anyone care to shed some light for me?