Creating .adm Files for the Win2K GPE
Win2K's GPE snap-in offers hundreds of policies. (SPE offers less than 100 policies.) Figure 2 shows the available scope of policy categories.
Only the policies available under the Administrative Templates nodes are direct registry entries; you can view or modify these templates as a basis for registry changes. The available policies cover almost every user setting or preference you can think of, so you aren't likely to need to create your own templates. But you might discover a registry setting that the templates don't already cover, or you might want to impose settings specific to user controls for inhouse software. Another reason to create your own template is to combine existing registry changes from the existing templates. You can then use this combo template to apply commonly invoked changes to specific groups of computers or users.
The relationship between the GPE snap-in and its templates is similar to the relationship between SPE and its templates. Figure 3 shows the policies for User Configuration\Administrative Templates\System. For the policy named Don't display welcome screen at logon, the following code is in the System.adm template:
POLICY !!NoWelcomeTips
KEYNAME "Software\Microsoft\
Windows\CurrentVersion\Policies\Explorer"
EXPLAIN !!NoWelcomeTips_Help
VALUENAME "NoWelcomeScreen"
END POLICY
In a GPE template, the POLICY section includes the registry key, even if the registry key is the same as the preceding or following policy. Note the two exclamation points to the left of the policy name; these marks identify a variable. The [Strings] section for this example includes the following code, which matches the text in the GPE snap-in:
NoWelcomeTips="Don't display welcome screen at logon"
EXPLAIN, which doesn't exist in SPE templates, also has two exclamation points as the first characters of its value, identifying a variable in the [Strings] section. Note that the string name is the same as the string name for the policy name, with the addition of an underscore and the word Help. In this case, the variable points to the text that appears on the Explain tab.
In the [Strings] section of System.adm, we find the variables that Figure 4, page 76, shows. The \n within the text inserts a carriage return. If you're creating policies, you don't need to write explainers. The system won't complain if you omit them.
Creating .adm Files for the NT or Win9x SPE
NT and Win9x implement ADM templates into SPE (i.e., poledit.exe). You must use the appropriate platform version of SPE to implement the policies you create in your .adm file. (For an example of how SPE and an .adm template correspond, see the sidebar "Make the Connection.") NT Server includes three templates:
- Common.admregistry settings common to both NT and Win9x
- Winnt.admregistry settings specific to NT
- Windows.admregistry settings specific to Win95
You can modify these templates, which reside in \%systemroot%\inf. For example, you can edit the templates to remove options you never want to implementan important ability if assistants in your IT department use SPE. You can also add options that the standard template files don't include. Templates have the following limitations:
- Policies are limited to the settings available in the HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER registry subkeys.
- You can't reference a registry key that requires binary data.
You can also create templates and save them in the \%systemroot%\inf folder. To use the templates, open SPE; choose Options, Policy Template from the menu bar; and select your file.
USER\Software\Microsoft\WindowsCurrentVersion\Explorer\MenuOrder. Deleting this key makes the contents of my Favorites and Start Menu folders appear in alphabetical order. In the .reg file, I simply insert a hyphen (-) inside the brackets that enclose the registry path to the subkey that I want to delete. However, I'm not sure how to use .reg files to delete individual registry values. I usually just delete the entire key and reimport the values I want.<br>
Patrick S. Seymour June 19, 2001