Solved

Custom .ADM - entering REG_EXPAND_SZ data into registry - Binary data using GPO?

Posted on 2004-09-24
1
2,579 Views
Last Modified: 2012-06-27
Hi all,

I'm trying to change the locations of some system folders via GPO. Now GPO and the standard .adm templates don't do what I want and some do more then they should? Ex. setting 'folder redirection' for 'Start Menu' will affect Startup and Program locations as well... I found the location in the registry that I need to change ( HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\ ) but if you just 'modify' the entry the type changes to "REG_SZ" from "REG_EXPAND_SZ". Not what I want because I need to use variables in the entry ex: %Userprofile%\somedir . So I found that you need to enter the info via Binary, which isn't a problem using regedit or what have you BUT, I need to do this via. GPO. So, I wrote my own .ADM as this:

CLASS USER

CATEGORY !!Company_Custom_Settings

KEYNAME "Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"
        CATEGORY !!CustomFolders
                POLICY !!CustomFolders_Programs
                        PART !!CustomFolders_ProgramsPath               EDITTEXT REQUIRED
                        VALUENAME "Programs"
                        END PART
                END POLICY

                POLICY !!CustomFolders_Startup
                        PART !!CustomFolders_StartupPath                EDITTEXT REQUIRED
                        VALUENAME "Startup"
                        END PART
                END POLICY

                POLICY !!CustomFolders_StartMenu
                        PART !!CustomFolders_StartMenuPath                EDITTEXT REQUIRED
                        VALUENAME "Start Menu"
                        END PART
                END POLICY

        END CATEGORY; CustomFolders

END CATEGORY

[strings]
Company_Custom_Settings=Company Custom Settings
customFolders=Folder Redirect
CustomFolders_Programs=User Program redirect
CustomFolders_ProgramsPath=The new User Programs path location
CustomFolders_Startup=User Startup redirect
CustomFolders_StartupPath=The new User Startup path location
CustomFolders_StartMenu=User Start Menu redirect
CustomFolders_StartMenuPath=The new User Start Menu path location



The problem is that it's the same as entering the data via 'modify' as described above, hence changing the type to "REG_SZ". Does anyone know how to enter data via and .ADM in a binary value? I've tried ( hex(2):03,42 etc ) but it just interpretes it as text...

Please help,
Cheers,
~Mike S.
0
Comment
Question by:siegi
1 Comment
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 12151118
No need to use binary data. Define the Edittext as Expandabletext, and it should create the correct type:

PART !!CustomFolders_StartMenuPath EDITTEXT EXPANDABLETEXT REQUIRED

Administrative Template File Format
http://msdn.microsoft.com/library/en-us/policy/policy/administrative_template_file_format.asp
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
Numerous times I have been asked this questions that what is it that makes my machine log on so slow, there have been cases where computers took 23 minute exactly after taking password and getting to the desktop. Interesting thing was the fact th…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question