Input can be provided in strValueName = "ProductName". Also this script can be pushed to large number of machines via SCCM, Landesk,Altiris tool.
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
set wshshell=Wscript.CreateObject("Wscript.Shell")
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Classes\Installer\Products\"
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
strValueName = "ProductName"
For Each subkey In arrSubKeys
strKy= strKeyPath&subkey
oReg.GetExpandedStringValue HKEY_LOCAL_MACHINE,strKy, _
strValueName,strValue
if Left(strValue,5)="Adobe" THEN
'Wscript.Echo strValue
'wscript.echo strKy&"\SourceList\Net\"
oReg.DeleteKey HKEY_LOCAL_MACHINE, strKy&"\SourceList\Net"
oReg.Deletekey HKEY_LOCAL_MACHINE,strKy&"\SourceList\Media"
oReg.Deletekey HKEY_LOCAL_MACHINE,strKy&"\SourceList"
oReg.Deletekey HKEY_LOCAL_MACHINE,strKy
end if
Next
Comments