Solved

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

Posted on 2004-09-24
1
2,585 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 85

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

728 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