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

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

Jean-François Pillou - Founder of CCM
Better known as Jeff, Jean-François Pillou is the founder of He is also CEO of CCM Benchmark and digital director at the Figaro Group.

Learn more about the CCM team