programming4us
programming4us
DESKTOP

Windows Server 2008 and Windows Vista : Using .adm Template Language (part 7)

12/4/2013 2:58:16 AM
4.4.4 DROPDOWNLIST

The DROPDOWNLIST syntax provides a combo box with a drop-down list style. It is similar to the COMBOBOX syntax, except that the actual registry value is converted to simple language text. The user can choose only one of the entries from the drop-down list. The DROPDOWNLIST syntax is preferable to the COMBOBOX syntax when the registry value does not indicate clearly what setting the policy will accomplish. To better illustrate this, let’s take a look at the COMBOBOX example with a DROPDOWNLIST solution:

POLICY !!ScreenSaverFilename
KEYNAME "Software\Policies\Microsoft\Windows\Control Panel\Desktop"
PART "What screen saver do you want?" DROPDOWNLIST
VALUENAME "SCRNSAVE.EXE"
ITEMLIST
NAME "Starfield"
VALUE C:\WINNT\System32\ssstars.scr
NAME "Bezier"
VALUE C:\WINNT\System32\ssbezier.scr
NAME "Flowerbox"
VALUE C:\WINNT\System32\ssflwbox.scr
END ITEMLIST
END PART
END POLICY

The resulting GPME text for this syntax and administrative template is shown in Figure 4.

Figure 4. The DROPDOWNLIST syntax allows you to supply a friendly list of names instead of the complex registry value name.


Tip

If any item in the drop-down list requires more than one word, you must use the STRINGS syntax for the entries; otherwise, the .adm template will generate an error during importing. The STRINGS syntax allows you to use a single word for each entry, but the GPME converts the string variable to the actual string for the list.


Note

Additional syntax that you can use in conjunction with DROPDOWNLIST includes KEYNAME, VALUENAME, DEFAULT, REQUIRED, ITEMLIST, END, NOSORT, and CLIENTEXT.


4.4.5 EDITTEXT

The EDITTEXT syntax allows the user to enter alphanumeric text into an edit field or text box. Here again is the example of editing text in the screen saver file name.

POLICY !!ScreenSaverFilename
KEYNAME "Software\Policies\Microsoft\Windows\Control Panel\Desktop"
PART !!ScreenSaverFilename EDITTEXT
VALUENAME "SCRNSAVE.EXE"
END PART
END POLICY

By default, the EDITTEXT syntax provides an empty text box for editing the policy. If you want to display an initial value in the text box, you can use the DEFAULT syntax along with the EDITTEXT syntax. The options you can use with EDITTEXT syntax include:

  • DEFAULT value Specifies the initial string to place in the edit field. If this option is not specified, the field is initially empty.

  • EXPANDABLETEXT Specifies that the text is set in the registry with the REG_EXPAND_SZ type. By default, the text is set in the registry with the REG_SZ type.

  • MAXLEN value Specifies the maximum length of a string. The string in the edit field is limited to this length.

  • REQUIRED Specifies that the GPME does not allow a policy containing this PART to be enabled unless a value has been entered for it.

  • OEMCONVERT Sets the ES_OEMCONVERT style in the edit field so that typed text is mapped from ASCII to OEM and back. ES_OEMCONVERT converts text entered in the edit control. The text is converted from the Windows character set (ASCII) to the OEM character set and then back to the Windows set. This ensures proper character conversion when the application calls the CharToOem <JavaScript:hhobj_1.Click()> function to convert an ASCII string in the edit control to OEM characters. This style is most useful for edit controls that contain file names.

Note

Additional syntax that you can use in conjunction with EDITTEXT includes KEYNAME, VALUENAME, DEFAULT, REQUIRED, MAXLENGTH, OEMCONVERT, END, EXPANDABLETEXT, and CLIENTEXT.

Other  
  •  Windows Server 2008 and Windows Vista : Creating Custom .adm Templates - A Simple .adm Template
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 5) - Optional Tasks for Implementing Software Restriction Policies
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 4) - Implementing Software Restriction Policies - Creating a Path Rule, Designating File Types
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 3) - Implementing Software Restriction Policies - Creating a Certificate Rule, Creating an Internet Zone Rule
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 2) - Implementing Software Restriction Policies - Creating a Hash Rule
  •  Windows Server 2003 : Implementing Software Restriction Policies (part 1)
  •  Windows Server 2003 : Troubleshooting Software Deployed with Group Policy - Software Deployment Troubleshooting Scenarios
  •  Windows Server 2003 : Maintaining Software Deployed with Group Policy (part 2) - Removing Applications Deployed with Group Policy
  •  Windows Server 2003 : Maintaining Software Deployed with Group Policy (part 1) - Upgrading Applications Deployed with Group Policy
  •  Windows 7 : Using WDS for Multicast Deployments (part 2) - Creating a Multicast Deployment
  •  
    Video
    PS4 game trailer XBox One game trailer
    WiiU game trailer 3ds game trailer
    Top 10 Video Game
    -   Company of Heroes 2: The British Forces [PC] Trailer
    -   SDCC 2015: Plants vs. Zombies Garden Warfare 2 | Seeds of Time Map Gameplay Reveal
    -   Microsoft HoloLens: Partner Spotlight with Case Western Reserve University
    -   Cossacks 3 [PC] Musketeer Animations Trailer
    -   Call Of Duty: Black Ops III [PS4/XOne/PC] Zombies - Shadows of Evil Trailer
    -   No Time To Explain [XOne/PC] Multiplayer Trailer
    -   Bierzerkers [PC] Early Access Trailer
    -   Downward [PC] Kickstarter Trailer
    -   Grip [PS4/PC] Trailer
    -   Hitman [PS4/XOne/PC] Debut Trailer
    -   Gears of War: Ultimate Edition [XOne] Recreating the Cinematics Trailer
    -   Gravity Falls: Legend of the Gnome Gemulets [3DS] Debut Trailer
    -   Street Fighter V [PS4/PC] Ken Trailer
    -   Doctor Who | Series 9 Teaser Trailer
    -   Transformers: Devastation | Gameplay Trailer (SDCC 2015)
    Game of War | Kate Upton Commercial
    programming4us
     
     
    programming4us