Add registry key command line

by admin on October 2, 2011

Using reg command we can add registry key from command line.  Below you can find some examples for the same.

Add a new registry value:

The command for adding new registry value is given below.

Reg Add Regkey /v RegValue /t RegType /d data

Regkey – Path of the node where the new registry value should be added.

RegValue : Name of the registry value that should be added

/t: Type of the registry value (REG_SZ, REG_DWORD, REG_BINARY)

Example:
Add a new registry value ‘userpath’ of type REG_EXPAND_SZ under the node ‘HKEY_CURRENT_USER\Environment’. Assign the value ‘C:\Windows’ to this new registry value.

reg  add  HKEY_CURRENT_USER\Environment  /v  userpath /t  REG_EXPAND_SZ  /d  C:\Windows

Add a new registry key

The command for adding new registry key is given below.

Reg  Add  Regkey

Example:
Add a new registry key ‘HKEY_CURRENT_USER\Software\Newregkey’.

reg  add  HKEY_CURRENT_USER\Software\Newregkey

Related Posts:

Delete registry key from Windows command prompt

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: