Jump to content

how to run a registry patch on shutdown/logoff


Recommended Posts

Posted

I'm trying to get windows to run a registry patch every time someone logs off or shuts down, but i've not a clue.

 

i would also like it to not display the "do you want to add to registry" warning to pop up, just

 

Any ideas?

Posted

Either use the 'reg' command line util in a script. Or export the registry settings from a machine with the configuration you want to a .reg file and import them with 'regedit /s somefile.reg' (the /s option prevents the dialog being displayed).

 

You can set either method up to run at logoff and/or shutdown via GPO settings.

Posted

ah sorry, my bad. :)

 

On the machine in question.

 

1) Start -> Run

2) gpedit.msc

3) Computer Configuration -> Windows Settings -> Scripts -> Shutdown

4) Add the script/commands you want.

Posted
Cheers man, just what i wanted.

 

any ideas how to put "regedit /s somefile.reg" as a vbs, i'm a bit rusty

 

Just use a batch file!

Posted

Set WshShell = CreateObject("Wscript.Shell")

 

WshShell.Run "Regedit /s C:\reg_file.reg"

 

If .Run does not work then use the .Exec method ie

 

WshShell.Exec

 

The question is if you want to use a batch file or a vbs :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...