ADMX file specify REG_EXPAND_SZ


I am having trouble specifying a registry string type as REG_EXPAND_SZ in an ADMX template.  The ADM method was something along the lines of


In the ADM format, but that obviously doesn't work in 2008 ADMX.  I attempted adding

required="true" expandable="true"

to the policy name tag with no results.

Thank you for any assistance.

Who is Participating?
omnipower321Connect With a Mentor Author Commented:
Solved it.

<policy name="MyComputerName" class="Machine" displayName="$(string.MyComputerName)" presentation="$(presentation.MyComputerName)" explainText="$(string.MyComputerName_Help)" key="SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}">
<parentCategory ref="2008_Profile_Management" />
<supportedOn ref="windows:SUPPORTED_WindowsVista" />
<text id="txtMyComputerName" valueName="LocalizedString" key="SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" expandable="true" />

Did not need to specify enabled and disabled values, and I was declaring the value name twice.  This works perfectly.
you can use the tool Reg2Adm to convert a reg file into adm adm file.
Maybe this could help you
omnipower321Author Commented:
Looking for ADMX rather than ADM, but thank you.  I tried the ADMX migrator from FullArmor, but the value keys come out blank every time.  I would like to know how to write it manually rather than rely on a converter as well for future use.
omnipower321Author Commented:
Ok, so I have made some progress, not much but some.

<policy name="MyComputerName" class="Machine" displayName="$(string.MyComputerName)" presentation="$(presentation.MyComputerName)" explainText="$(string.MyComputerName_Help)" key="SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" valueName="LocalizedString">
<parentCategory ref="2008_Profile_Management" />
<supportedOn ref="windows:SUPPORTED_WindowsVista" />
   <string>%USERNAME% on %COMPUTERNAME%</string>
   <string>Name not configured</string>
   <text id="txtMyComputerName" valueName="LocalizedString" key="SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" required="true" expandable="true" soft="true" />

So there is my policy, I have the apropriate language entries as well:

   <presentation id="MyComputerName">
   <textBox refId="txtMyComputerName">
   <label>Expanding key for environment variables</label>

So this creates a REG_SZ named LocalizedString with a value of %USERNAME% on %COMPUTERNAME% which is not what I need, but it also creates a REG_EXPAND_SZ with no name and no value.

So close!  Where am I messed up?
All Courses

From novice to tech pro — start learning today.