Adding .reg to startup/shutdown GPO

  • Thread starter Thread starter Richard
  • Start date Start date
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
 
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
 
Back
Top