Categories: System Configuration

Add registry key command line

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_USEREnvironment’. Assign the value ‘C:Windows’ to this new registry value.

reg  add  HKEY_CURRENT_USEREnvironment  /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_USERSoftwareNewregkey’.

reg  add  HKEY_CURRENT_USERSoftwareNewregkey
Srini

View Comments

  • please expand on how to do this for us new newbies! Is this what I need to get console input of "regedit.exe" not result in "not recognized as internal or external command. Thank you.

Recent Posts

Add new user account from command line (CMD)

Adding users from command line is much easier than going through the UI. It saves…

4 years ago

Delete directory from command line [Rmdir]

Do you want to delete a directory from Windows command prompt(CMD)? This post explains how…

4 years ago

TaskKill: Kill process from command line (CMD)

We can kill a process from GUI using Task manager. If you want to do…

4 years ago

Kill Chrome from command line

Chrome is definitely the stable browser compared to other ones and it has been my…

4 years ago

Find windows OS version from command line

Windows has multiple command line utilities that can help find the version of the Windows…

4 years ago

How to check if Windows 32 or 64 bit?

There are multiple ways to check whether a Windows computer is running 32-bit OS or…

7 years ago