We have an issue where we need to modify keys for users that are not currently logged into the machines and those that will login set a default. I know the best way to do this is a domain policy but that option is unavailable. Is there any good way to modify these keys programmaticly, or remotely short of having an exe on each machine run 开发者_JS百科when the user logs in.
Richard Jones has written a library hivex which provides read/write access raw Windows registry hive files. Also see its git repository and the mailing list announcement. It exposes a C API with Perl, Python, and OCaml bindings.
You could try using that library to write a script to perform the manipulations you need.
I have had to do this in the past for setting default power schemes, since every computer has to be touched I updated the logon script to loop through all of the profiles in Documents and Settings and loading all of the ntuser.dat files to update, the scripting language I used was WinBatch, it has specific functions for loading registry hives.
Now since you mentioned that this needs to be done for computers with no logged in users I would suggest running the program with a tool such as Microsoft SMS or Altaris if you have it available. Other than that I guess psexec could be your friend.
精彩评论