Help with VBS script to replace string value in Registry


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
  • And did you try just a REG file import? - dedenker 6 years ago
  • Hi,
    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 6 years ago
  • Thanks for the above, I checked the extension table and noticed that the component associated with the file extensions was pointing to a the zip.exe component, I changed the reference to point to the ci_start.exe_Com and it all works fine and uninstalls cleanly. :) - djjass 6 years ago

Answers (1)

Answer Summary:
Posted by: EdT 6 years ago
Red Belt
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.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ