Windows - Manage the registry using the command prompt

Ask a question

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 
Jean-François Pillou

CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jeff Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.

Learn more about the CCM team