Solved

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

910 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

22 Experts available now in Live!

Get 1:1 Help Now