The_Traveller Posted November 17, 2006 Posted November 17, 2006 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?
Quackers Posted November 17, 2006 Posted November 17, 2006 Using Group Policy assign a batch file as a script. In the batch put for example regedit /s "L:\Scripts\Configs\lrc\power.reg"
Geoff Posted November 17, 2006 Posted November 17, 2006 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.
The_Traveller Posted November 17, 2006 Author Posted November 17, 2006 Thanks for that, but it's just for one pc, is there any way it can be done locally?
Geoff Posted November 17, 2006 Posted November 17, 2006 1) Right click Start button 2) Open All Users 3) Programs -> Startup 4) Stick a script/shortcut in there.
Geoff Posted November 17, 2006 Posted November 17, 2006 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.
The_Traveller Posted November 18, 2006 Author Posted November 18, 2006 Cheers man, just what i wanted. any ideas how to put "regedit /s somefile.reg" as a vbs, i'm a bit rusty
Geoff Posted November 18, 2006 Posted November 18, 2006 You don't need to. If you use the method above, you put 'regedit' as the program and '/s somefile.reg' as the parameters.
Ric_ Posted November 18, 2006 Posted November 18, 2006 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!
mac_shinobi Posted November 18, 2006 Posted November 18, 2006 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
The_Traveller Posted November 19, 2006 Author Posted November 19, 2006 couldn't get the batch file to run
Ric_ Posted November 20, 2006 Posted November 20, 2006 couldn't get the batch file to run odd... any messages in the logs?
The_Traveller Posted November 20, 2006 Author Posted November 20, 2006 Haven't checked logs, but i got the vbs to work, thanks to you lot cheers!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now