Windows - Manage the registry using the command prompt

February 2017


Windows - Manage the registry using the command prompt



The registry can be edited via the command prompt using the REG command .

This command is useful when your computer is infected by a virus preventing access to the registry or when you want to create a batch that modifies the registry.

Open the command prompt


To get more information about the REG command, just add /? after the command.
Examples of use:
  • REG /?
  • REG ADD /?
  • REG COPY /?

Adding items to the registry

Add a key

REG ADD [location of the key][name of the new key] 

Add a value

  • REG ADD [location of the new value]/V[value name]/T [value type]/D [value data] 
  • The /T is to specify the type of value to add. There are six types of values:
  • REG_SZ
  • REG_MULTI_SZ
  • REG_EXPAND_SZ
  • REG_DWORD
  • REG_BINARY
  • REG_NONE

Add default value

REG ADD [location of the new value]/VE/D [data value]  

Deleting items from the registry

Delete a key

  • REG DELETE [key name]  

Removes the selected key, subkeys and values it contains.

Delete a value

  • REG DELETE [key name]/V[value name] 

Delete the default value

  • REG DELETE [key name]/VE 

Related


Published by jak58. Latest update on February 9, 2015 at 04:51 AM by jak58.
This document, titled "Windows - Manage the registry using the command prompt," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).