Add a Registry Key via Group Policy

B

bjorgenson

How can I add a new registry key using group policy? I don't want to
change an existing key but add a new one.

Is there a way using ADM templates? If so, what is the syntax?

This is what I want to add:

HKEY_CLASSES_ROOT\Folder\shell\PC Info\command

VALUE=c:\my program.exe
 
M

Mark Heitbrink [MVP]

Hi,

How can I add a new registry key using group policy? I don't want to
change an existing key but add a new one.

Create an own ADM Template.
Is there a way using ADM templates? If so, what is the syntax?
http://www.oreilly.de/catalog/winsyspe/chapter/ch08.html

This is what I want to add:
HKEY_CLASSES_ROOT\Folder\shell\PC Info\command
VALUE=c:\my program.exe

HKClasses Root is just a link to:
HKLM\Software\Classes

If your type of VALUE is the (Default) inside the registry
you have to define it like that: ""
(no name given, but enclosed in Qoutes)

----- shell.adm -----
CLASS MACHINE
CATEGORY "give it a name you want"
POLICY "give it a name you want"
KEYNAME "SOFTWARE\Classes\Folder\shell\PC Info\command"
PART "whatever you want to set:" EDITTEXT
VALUENAME ""
END PART
END POLICY
END CATEGORY

----- shell.adm -----

Make sure, that you change the View settings after importing
the ADM Template and uncheck in the filtering:
"... only full managed"

Or just simply use the Registry Extension from DesktopStandard.
(Freeware) than you don´t have to create an ADM.

Mark
 
B

bjorgenson

I'm confused on the PART section. The oreily.de site does not explain
it well enough. What would I use in this case? I don't want a checkbox
or anything like that, just an EDITTEXT field to be able to change the
path of my executable.

Thanks,
Brian
 
B

bjorgenson

OK, I think I have it figured out but I do want to change my default
key value. The default value has to remain a REG_SZ.
 
B

bjorgenson

Nevermind, figured it out. This is what I used:

CLASS MACHINE
CATEGORY "PC Info"
POLICY "PC Info Policy"
EXPLAIN !!SetPath
KEYNAME "SOFTWARE\Classes\Folder\shell\PC Info\command"
PART !!PathName EDITTEXT
Valuename ""
END PART
END POLICY
END CATEGORY

[strings]
SetPath="Enter path to location of executable"
PathName="Enter path:"

Thanks for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top