If you need to add a registry entry to a Windows PC most often techs will simply export the key and entries they want and then use the
REGEDIT /S command to push that entry onto another PC.
For example if you want to disable the Cortana bar (but not Windows Search), you save the following into a file named DISABLE-CORTANA.REG
Windows Registry Editor Version 5.00
Then you simply put that file on one of your servers and push it out to your PC’s using something like:
regedit /s "\<Your-Server><Your-Share>Scriptsdisable-cortana.reg"
HOW TO ADD A REGISTRY KEY USING COMMAND LINE SCRIPT
if you have a simple registry change you want to make you can avoid the .REG file and simply use
REG ADD command to make your change. For instance:
reg add "HKLMSOFTWAREPoliciesMicrosoftWindowsWindows Search" /v AllowCortana /t REG_DWORD /d 1 /f
The switches mean:
||Specifies the name of the registry entry to be added under the specified subkey.
||Specifies that the registry entry that is added to the registry has a null value.
||Specifies the type for the registry entry. Type must be one of the following:
||Specifies the character to be used to separate multiple instances of data when the REG_MULTI_SZ data type is specified and more than one entry needs to be listed. If not specified, the default separator is |