online help

Description
©www.microsoft.com

To create a custom .adm file:

  1. Create a backup copy of the Winnt.adm file in the %systemroot%\inf directory.
    Use a text editor to open the Winnt.adm file. The first entry of this file is CLASS xxxx, where xxxx could be either:
    • MACHINE = This section includes all entries available in the Local Computer/DefaultComputer icon.
    • USER = This section includes all entries available to modify user-specific settings.
    These are the only two classes that are valid within the System Policy Editor. The System Policy Editor checks the syntax of each .adm file when the files are loaded, and displays a message if any errors are found.
  2. Choose the CLASS in which you want your custom entries to appear.
  3. Create categories by using the keyword CATEGORY followed by a space and !!variable. The System Policy Editor requires that anything preceded by !! must have a string defined in the [strings] section of the .adm file. This allows the editor to use variables to define long strings of text that will appear in the user interface a single time, even if these strings are used in multiple locations in the .adm file. For example, to open a category you would use:

    CATEGORY !!MyNewCategory
    To close the category after filling in the options, you would use:
    END CATEGORY ; MyNewCategory

    These can be nested to create sub-categories as follows:
    CATEGORY !!FirstCategory
    CATEGORY !!SecondCategory
    CATEGORY !!ThirdCategory
    ...
    ...
    END CATEGORY ; ThirdCategory
    END CATEGORY ; SecondCategory
    END CATEGORY ; FirstCategory

    Be sure to specify the text for the variables you used above. In this case, in the [strings] section of the .adm file, you would need to include:
    FirstCategory="My First Category"
    SecondCategory="My Second Category"
    ThirdCategory="My Third Category"

  4. Within each category, define the registry key that will be modified. To do this, use the keyword KEYNAME followed by the registry path to the key that contains the value you want to change. Note that due to the CLASS you are in, you do not need to specify HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER. For example, you can use:
    KEYNAME System\CurrentControlSet\Services\
    LanManServer\Parameters
  5. Identify the policy that specifies which options the user can modify. Use the keyword POLICY for this, followed by !!variable. For example:

    POLICY !!MyFirstPolicy
    Be sure to define MyFirstPolicy in the [strings] section of the .adm file. Complete the policy specifics, and finish with an END POLICY statement.

    Define the options available within the policy.
    • Use the keyword VALUENAME to identify the registry value that an administrator can modify. For example:
    VALUENAME MyFirstValue
    Remember that the VALUENAME needs to be within a PART if the option is selected within the lower pane of the System Policy Editor (see the discussion of PART and the code example below).
    If not specified otherwise, the value will be written in the following format when any administratory checks or unchecks the option:
    Checked: REG_DWORD with a value of 1
    Unchecked: Removes the value completely

    Other options can specify what the user selects from and what gets written to the registry.
    • Use the keyword PART to specify options, drop-down list boxes, text boxes, and text in the lower pane of the System Policy Editor. PART is similar to CATEGORY, and uses the syntax:
    PART !!MyVariable FLAG
    ...
    END PART

    where FLAG is one or more of the following:
    • TEXT—Displays text only, for example:
    PART !!MyPolicy TEXT
    END PART
    • NUMERIC—Writes the value to the registry with data type REG_DWORD, for example:
    PART !!MyPolicy NUMERIC
    VALUENAME ValueToBeChanged
    END PART
    • DROPDOWNLIST—Displays a list box of options to choose from, for example:
    PART !!MyPolicy DROPDOWNLIST
    VALUENAME ValueToBeChanged
    ITEMLIST
    NAME "First" VALUE NUMERIC 1
    NAME "Second" VALUE NUMERIC 2
    NAME "Third" VALUE NUMERIC 3
    NAME "Fourth" VALUE NUMERIC 4
    END ITEMLIST
    END PART
    • EDITTEXT—Writes the value to the registry with data type REG_SZ, for example:
    PART !!MyPolicy EDITTEXT
    VALUENAME ValueToBeChanged
    END PART
    • REQUIRED—Generates an error if the user does not enter a value, for example:
    PART !!MyPolicy EDITTEXT REQUIRED
    VALUENAME ValueToBeChanged
    END PART
    • EXPANDABLETEXT—Writes the value to the registry with data type REG_EXPAND_SZ, for example:
    PART !!MyPolicy EDITTEXT EXPANDABLETEXT
    VALUENAME ValueToBeChanged
    END PART
    • MAXLEN—Specifies the maximum length of text, for example:
    PART !!MyPolicy EDITTEXT
    VALUENAME ValueToBeChanged
    MAXLEN 4
    END PART
    • DEFAULT—Specifies the default value for text or numeric data, for example:
    PART !!MyPolicy EDITTEXT
    DEFAULT !!MySampleText
    VALUENAME ValueToBeChanged
    END PART

    or

    PART !!MyPolicy NUMERIC
    DEFAULT 5
    VALUENAME ValueToBeChanged
    END PART
    • MIN and MAX—These specify the lowest and highest valid values respectively, for example:
    PART !!MyPolicy NUMERIC
    MIN 100 MAX 999 DEFAULT 55
    VALUENAME ValueToBeChanged
    END PART
    • Use the keywords VALUEOFF and VALUEON to write specific values based on the state of the option, for example:
    POLICY !!MyPolicy
    KEYNAME ....
    VALUENAME ValueToBeChanged
    VALUEON "Turned On" VALUEOFF "Turned Off"
    END POLICY

    or

    POLICY !!MyPolicy
    KEYNAME ....
    VALUENAME ValueToBeChanged
    VALUEON 5 VALUEOFF 10
    END POLICY
  6. Save and test your file.
Note that if you modify an .adm file while the System Policy Editor application is running, you will need to reload the file. From the Options menu, select Policy Template, and press OK. This reloads the structure, and your new entries will be available. (You do not need to perform this step if you modify a file before starting the System Policy Editor; the reload is done automatically each time the System Policy Editor starts.)