Help with VBS script to replace string value in Registry
Hi
I'm having a some trouble getting a string value replaced in a registry key under HKCR.
I currently have the following value HKCR\cadwork.ivz\shell\Open\command\Default
with the string value "C:\Program Files (x86)\cadwork.dir\COM\zip.exe" "%1" %2 %3 %4 %5 %6 %7 %8 I would like to change this same string value to "C:\Program Files (x86)\cadwork.dir\ci_start.exe" "%1" %2 %3 %4 %5 %6 %7 %8
The whole issue has come about due to our version of install shield not extracting COM registration correctly and some file associations are not working.
I'm wondering if anybody has anything that might be able to share to do the task above?
3 Comments
[ + ] Show comments
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
EdT
10 years ago
What version of installshield out of interest?
Have you considered what you will do during uninstall? Will you remove existing settings or restore previous settings?
If the native install is via MSI, I would use a transform to modify the existing value installed by the vendor to the value you need for it to work in your environment.
at the beginning I would suggest to try to configure it via MSI. If this is not added directly into Registry table it may be installed via Extension table and then you need to make sure that file:
"C:\Program Files (x86)\cadwork.dir\ci_start.exe"
is a part of your MSI installer and is set as KeyPath for associated Component.
Then navigate to Extension table, find in ProID column 'cadwork.ivz' and verify if Component in this row is a Component with KeyPath set to correct file:
"C:\Program Files (x86)\cadwork.dir\ci_start.exe"
Probably in your case it will point to "C:\Program Files (x86)\cadwork.dir\COM\zip.exe" so you will need to find appropriate Component and use it in Extension table.
If this will not help you may try with following VBS Code:
Set objShell = CreateObject("Wscript.Shell")
objShell.RegWrite "HKEY_CLASSES_ROOT\cadwork.ivz\shell\Open\command\","""C:\Program Files (x86)\cadwork.dir\ci_start.exe"" ""%1"" %2 %3 %4 %5 %6 %7 %8","REG_SZ" - rad33k 10 years ago