After exporting the desired registry key, use the following command to silently import any registry key:
Regedit /s RegistryFile.reg
- Create the following .BAT file to import the registry key file on the client, for the purposes of this document we will call it "Myfile.reg"
regedit /s Myfile.reg
- Add the "Myfile.reg" file as an additional file in the distribution package so that we don't need to specify the path of "Myfile.reg" in the batch file. The .reg file will be downloaded to the same location as the .bat file in the SDMCACHE directory on the client.
- Schedule the task on target client machine.
Registry changes made as local system will not touch the HKEY_CURRENT_USER hive. If the registry key to be imported is in the HKEY_CURRENT_USER hive, then local system will not be able to make the change. Use the runasuser.exe instead to import a user specific registry key.