Solved

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

Posted on 2004-09-24
1
2,569 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 83

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now