How can I create a registry script file that I can distribute through Group Policy?

110 pts.
Tags:
Group Policy
Registry Script
How can I create a registry script file that I can distribute through Group Policy? I want this registry key to be added using GP. Here is what I want the script to do reg add HKCUSoftwareMicrosoftOffice11.0WordOptions /v NoReReg /t REG_DWORD /d 1 If I saved this as a reg. document and try to run it, I get “cannot import ...The specified file is not a registry script.”
ASKED: July 9, 2008  2:57 PM
UPDATED: April 5, 2009  5:36 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Create a VBScript instead:

<pre>const HKEY_LOCAL_MACHINE = &H80000002
strComputer = “.”
Set StdOut = WScript.StdOut

Set oReg=GetObject(“winmgmts:{impersonationLevel=impersonate}!” &_
strComputer & “\root\default:StdRegProv”)

strKeyPath = “SOFTWARE\System Admin Scripting Guide”
strValueName = “String Value Name”
strValue = “string value”
oReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

strValueName = “DWORD Value Name”
dwValue = 82
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

</pre>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following