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?
Printable View
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?
Using Group Policy assign a batch file as a script. In the batch put for example
regedit /s "L:\Scripts\Configs\lrc\power.reg"
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.
Thanks for that, but it's just for one pc, is there any way it can be done locally?
1) Right click Start button
2) Open All Users
3) Programs -> Startup
4) Stick a script/shortcut in there.
i want it on shut down only
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.
Cheers man, just what i wanted.
any ideas how to put "regedit /s somefile.reg" as a vbs, i'm a bit rusty
You don't need to. If you use the method above, you put 'regedit' as the program and '/s somefile.reg' as the parameters.
Just use a batch file!Quote:
Originally Posted by The_Traveller
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 :)
couldn't get the batch file to run
odd... any messages in the logs?Quote:
Originally Posted by The_Traveller
Haven't checked logs, but i got the vbs to work, thanks to you lot cheers!