jaya31
asked on
Script to Delete registry entry based on Product name
Hi Experts,
I need help with creating a script that will delete a registry entry based on entry name. Reason, we are having issues installing adobe flash through SCCM. Researching the issue, we found that rouge entries of Adobe 11 under HKEY_CLASSES_ROOT\Installe r\Products is the cause, if we delete those entries and then deploy the latest version it works perfect.
The problem is that under HKEY_CLASSES_ROOT\Installe r\Products \ the next key varies based on the version of Adobe flash. So Adobe
(HKEY_CLASSES_ROOT\Install er\Product s\A180D907 68E45F34D9 76E6FA74EE 85E5) could be version 11.0.0.226 and then it changes based on older and newer versions of 11.
Instead of manually going through half of our organization, is there a script that will run and delete entries under HKEY_CLASSES_ROOT\Installe r\Products with the name "Adobe Flash Player 11 " as that is listed as product name under the key.
Thanks in Advance for you help.
I need help with creating a script that will delete a registry entry based on entry name. Reason, we are having issues installing adobe flash through SCCM. Researching the issue, we found that rouge entries of Adobe 11 under HKEY_CLASSES_ROOT\Installe
The problem is that under HKEY_CLASSES_ROOT\Installe
(HKEY_CLASSES_ROOT\Install
Instead of manually going through half of our organization, is there a script that will run and delete entries under HKEY_CLASSES_ROOT\Installe
Thanks in Advance for you help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To quote your original question:
"Adobe Flash Player 11 "
I even removed the trailing space to fix your error. But now you show me it should be:
"Adobe Flash Player 11 Plugin"
As programming is quite an exact science, if you give the wrong info, you will get a non-working script.
Use the original script, find:
Replace with:
"Adobe Flash Player 11 "
I even removed the trailing space to fix your error. But now you show me it should be:
"Adobe Flash Player 11 Plugin"
As programming is quite an exact science, if you give the wrong info, you will get a non-working script.
Use the original script, find:
if ((strValueName = "ProductName") and (strValue = "Adobe Flash Player 11")) then
Replace with:
if ((strValueName = "ProductName") and (strValue = "Adobe Flash Player 11 Plugin")) then
ASKER
Hi Kimputer,
This works great, thank much. Apologies, my mistake on the name.
I just have one follow up question before closing. The subroutine at the bottom of the script refers to deleting keys from HKEY_CURRENT_USER. Again, not a programming\scripting person, just wanted to make sure there was nothing else happening.
I did run it on a test machine and worked deleting the key referring to Adobe, and didn't experience anything adverse. Thanks again.
This works great, thank much. Apologies, my mistake on the name.
I just have one follow up question before closing. The subroutine at the bottom of the script refers to deleting keys from HKEY_CURRENT_USER. Again, not a programming\scripting person, just wanted to make sure there was nothing else happening.
I did run it on a test machine and worked deleting the key referring to Adobe, and didn't experience anything adverse. Thanks again.
The lower part is indeed a sub routine, and hence it's not really that key, but the key you input when you call the routine. It's indeed prone to misinterpretation, and I should have used a better variable name that would indicate it's a variable and not a fixed value.
ASKER
Thanks again, just wanted to make sure. Much appreciated, this is exactly what I needed.
ASKER
I tried to saved the script, renamed it vbs and vbsx and ran it through elevated cmd prompt and it doesn't deleted the key. Below is the exported registry key that points to what I want deleted, as mentioned, after under HCR\installer\products that A180d... name changes based on versions. I'm not a scripting guy, maybe I left something out that is needed to delete or not running properly. Thanks again.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Install
"Clients"=hex(7):3a,00,00,
"ProductName"="Adobe Flash Player 11 Plugin"
"PackageCode"="3DC1AC4F710
"Language"=dword:00000409
"Version"=dword:0b040192
"Assignment"=dword:0000000
"AdvertiseFlags"=dword:000
"ProductIcon"="C:\\Windows
"InstanceType"=dword:00000
"AuthorizedLUAApp"=dword:0
"DeploymentFlags"=dword:00
[HKEY_CLASSES_ROOT\Install
"PackageName"="install_fla
"LastUsedSource"="n;1;\\\\
[HKEY_CLASSES_ROOT\Install
"DiskPrompt"="[1]"
"1"="DISK1;1"
[HKEY_CLASSES_ROOT\Install
"1"=hex(2):5c,00,5c,00,66,
5c,00,73,00,6f,00,66,00,74
00,31,00,2e,00,34,00,2e,00
00,00