Adding .reg to startup/shutdown GPO

R

Richard

I have a .reg file that I would like to setup as system startup/shutdown
script GPO in AD. Is there a switch or parameter to suppress the "Are you
sure you want to add information in the registry" prompt?

This is what I have in the .reg file and the file is called "CSA.REG"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CSAgent]
"Type"=dword:00000010
"Start"=dword:00000004


I just want the script to overwrite the existing key without any prompts.
Any help is appreciated. Thanks!

Richard
 
J

Jon Wallace

Hi Richard,

You can use the /S switch to suppress in message so for example REGEDT32.EXE
/S CSA.REG

The other (and cleaner) option you have if you want to do this in a group
policy script is to set these using VBScript - here is a small code sample
you could use...

-----

Option Explicit

Dim oWshShell
Set oWshShell = CreateObject("Wscript.Shell")

oWshShell.RegWrite "HKCU\CurrentControlSet\Services\CSAgent\Type", 10,
"REG_DWORD"
oWshShell.RegWrite "HKCU\CurrentControlSet\Services\CSAgent\Start", 4,
"REG_DWORD"

-----

Hope this helps you.

Regards,
Jon
 

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