110 pts.
 How can I create a registry script file that I can distribute through Group Policy?
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.”

Software/Hardware used:
ASKED: July 9, 2008  2:57 PM
UPDATED: April 5, 2009  5:36 AM

Answer Wiki:
Create a VBScript instead: <pre>const HKEY_LOCAL_MACHINE = &H80000002 strComputer = "." Set StdOut = WScript.StdOut Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!" &_ strComputer & "rootdefault:StdRegProv") strKeyPath = "SOFTWARESystem 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>
Last Wiki Answer Submitted:  April 5, 2009  5:36 am  by  alessandro.panzetta   9,695 pts.
All Answer Wiki Contributors:  alessandro.panzetta   9,695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _