Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
iamnacho Frequent Contributor.
Frequent Contributor.
95 views

Trouble setting Registry key named Default

Hello,

I'm having trouble setting a registry value with a name of Default. I do not mean (Default) or @ ... I mean just the string "Default". (I didn't name this value, but I would like to modify it using a ZCM bundle).  Here's how to reproduce:

In a ZCM Bundle I add a Registry Edit Action, Then add a test key & create a Value under that test key.

I Set these settings:
Value Type = String
Value Name = Default
String Data = test data here
Registry Operation = Create Always.

Then press OK
If I open the newly create value immediately, it looks correct.

Then I press OK on the Registry Edit Action & Apply on the Actions tab of the bundle.
Then I go back into the Registry Edit Action and look at the value that I created and now it shows as Value Type = Default

If I deploy that bundle to a workstation, The (Default) registry value is being modified. (which doesn't surprise me since it was changed when I hit apply earlier).

 

Is there a special way I should be entering the string "Default" so that it does not get interpreted as "(Default)" ?

 

Thanks!

Labels (1)
0 Likes
4 Replies
Micro Focus Expert
Micro Focus Expert

Re: Trouble setting Registry key named Default

I suspect you will need to call a script action such as....

reg add hklm\software\acme /v default /t REG_SZ /d HiThere /f

or create a bundle that calls a "REG" file with the desired values.

Some quick tests seem to show  the REGEDIT action itself will assume that "DEFAULT" is "(DEFAULT)".

Not the Wisest of Choices for a Value name...but I'm sure you are not the one who wrote the app that makes use of it .....

--
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!
0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Trouble setting Registry key named Default

Oh and I might suggest reading....

https://community.microfocus.com/t5/ZENworks-Tips-Information/ZENworks-Understanding-how-to-use-Environment-Variables-in/ta-p/2703302

While the reason the article was written was to show how to work with variables, it highlights a myriad of ways to update the registry with ZCM.

--
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!
0 Likes
iamnacho Frequent Contributor.
Frequent Contributor.

Re: Trouble setting Registry key named Default

Yes, I'm not in charge of the software that uses this unfortunately named key. 🙂

Calling Reg from a script action works.   I appreciate the tip/help.

 

I do understand why someone may have requested/wanted it to work the way it does, but I also see there also is a "Default" value type in the drop down..  So from my perspective, it shouldn't matter what I put in the value name if I set the Type = String, it shouldn't convert to a different Value Type.

Do you think the current behavior would be accepted as a bug and if I open an SR? 

Thanks!

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: Trouble setting Registry key named Default

I would just be leary about trying to fix it.

Folks could easily be confused by the differences between @, (DEFAULT), and DEFAULT.

When someone says I want to set the "DEFAULT" registry key, they almost universally mean @ or (DEFAULT) and not a seperate VALUE named "DEFAULT".

Adding additional handling options to handle very rare case is most likely to confuse users when they need to update @ or (Default) and will now need to know how to differentiate from a separate value called "default".

The fact his behavior has likely been this way for 10+ years and this is the first such report, it's probably easiest to simply leave as is and just handle updating that key in rare off cases via other means.

Only if a recent prior version behaved different would I worry about it, but I would find that unlikely as there is rarely much code change is this part of code.

 

--
Please give a hearty thumbs up to any post you find helpful!
To find articles by Craig Wilson simply follow the link: Craig Wilson's Tips!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.