How to Edit the Windows Registry in the Command Prompt

Trending 2 months ago

The Registry Editor is nan first point Windows users bring up erstwhile it comes to editing nan Windows Registry. However, if you don't want to woody pinch a distracting GUI and excessively galore clicks, there's a simpler-looking instrumentality you tin use: nan Command Prompt.

Although utilizing it takes a small much know-how than nan Registry Editor, our guideline should beryllium capable to get you started.

How to View nan List of Registry Commands successful Command Prompt

the bid to position each reg commands

There aren't a batch of commands erstwhile it comes to editing nan registry utilizing Command Line. To position them all, open Command Prompt arsenic an administrator and tally nan beneath bid successful Command Prompt:

reg /?

Command Prompt will past database nan commands, specified arsenic reg add, reg delete, reg copy, and reg save.

the database reg commands successful Command Prompt

If you want to spot much accusation astir them, conscionable adhd nan /? move astatine nan extremity of nan command. For, example, if you want to find retired what nan reg add bid does, you'd participate nan beneath command:

reg adhd /?

After you tally it, you'll get each nan specifications connected what it does and really to usage it.

details of nan reg adhd bid successful Command Prompt

If you're uncovering it difficult nan commands retired connected your own, don't worry. We will simplify it for you and show you really to get started utilizing them.

Add and Delete Keys successful nan Windows Registry

To adhd a cardinal to nan registry utilizing Command Prompt, you request to usage nan reg add bid while specifying nan way to nan caller cardinal and whether you want to unit nan cognition pinch nan /f switch (this will bypass nan request for nan confirmation prompt).

Here's an example:

REG Add HKLM\SOFTWARE\MyNewKey /f

In nan supra command, we're adding nan MyNewKey subkey to nan KHLM/Software key. If you spell to nan Registry Editor and grow that key, you'll beryllium capable to spot nan MyNewKey subkey wrong it.

Deleting nan cardinal is elemental arsenic well, arsenic you conscionable request to switch add pinch delete successful nan supra example. Here's how:

reg delete HKLM\SOFTWARE\MyNewKey /f

Now nan MySubKey cardinal will vanish successful nan Registry Editor.

How to Add, Modify, and Delete Values successful nan Windows Registry

adding a worth to Windows registry successful Command Prompt

To adhd aliases modify a worth cardinal successful nan registry utilizing Command Prompt, you'll still usage nan reg add bid for illustration above. However, this time, you'll besides person to specify nan pursuing parameters: worth (/v), worth type (/t), and worth information (/d). Here's an illustration of what nan bid would like:

reg adhd HKLM\SOFTWARE\MyNewKey /v MyValue /t REG_DWORD /d "1" /f

Once you tally nan command, you will beryllium capable to find nan worth successful nan Registry Editor. And if nan cardinal doesn't exist, Command Prompt will create it.

The Windows Registry uses respective worth types, and here's a array of nan communal ones:

Value Type

Description

REG_NONE

No worth type

REG_SZ

String value

REG_MULTI_SZ

Multi-string value

REG_EXPAND_SZ

Expanded drawstring value

REG_DWORD

32-bit DWORD value

REG_QWORD

64-bit QWORD value

REG_BINARY

Binary value

To delete nan value, you conscionable request to usage nan reg delete bid while specifying nan way to nan key, and nan sanction of nan value. Here's an illustration of deleting nan worth we created earlier:

reg delete HKLM\SOFTWARE\MyNewKey /v MyValue /f

After moving nan supra bid successfully, nan worth should vanish from nan Registry Editor.

How to Copy Registry Entries From One Key to Another

transfering entries from 1 registry cardinal to different successful Command Prompt

Sometimes, you mightiness want to transcript nan values from 1 cardinal to different successful nan registry. This is arsenic easy arsenic utilizing nan reg copy bid while specifying nan cardinal you're copying them from and nan 1 you're copying them to (keep successful mind that some keys person to already beryllium earlier you tally nan command). Here's an example:

reg transcript HKLM\SOFTWARE\MyNewKey1 HKLM\SOFTWARE\MyNewKey2 /s

The /s move astatine nan extremity tells Command Prompt that it should transcript each subkey and worth successful nan first cardinal (MyNewKey1) into nan 2nd 1 (MyNewKey2).

Unfortunately, there's nary measurement to transcript circumstantial values from 1 cardinal to another. You'll person to usage nan Registry Editor for that.

How to Import Registry Entries

importing a registry record successful Command Prompt

If you person created a Windows Registry file aliases downloaded it elsewhere, you tin import it into nan registry utilizing nan reg import command. All you request to do is specify nan way to nan registry record and Command Prompt will do nan rest. Here's an example:

reg import C:\Users\CHIFUNDO\Desktop\MyRegFile.reg

Once you tally that command, nan contents of nan reg record will beryllium merged pinch nan registry.

How to Export Registry Entries

exproting a registry cardinal successful Command Prompt

You tin export a cardinal successful nan registry utilizing nan reg export bid while specifying nan way of nan cardinal you want to export and nan record you want to create. This comes successful useful erstwhile you request to backmost up definite keys and values to reconstruct them elsewhere. Here's an example:

reg export "HKLM\SOFTWARE\MyNewKey" D:\Reg_Backup\CHIFUNDO\Desktop\MyRegFile.reg

After you tally nan bid successfully, cheque nan location you entered, and you'll find nan cardinal and its associated subkeys and values person been exported successfully. In our case, it will create a record called MyRegFile.reg and prevention it connected nan desktop.

You tin besides export a circumstantial worth utilizing nan reg query bid and see nan key, value, and way to nan registry record you want to export nan worth to. Here's an example.

reg query HKLM\SOFTWARE\MyNewKey /v MyValue > C:\Users\CHIFUNDO\Desktop\MyRegFile.reg

The resulting registry record will only incorporate nan cardinal and nan circumstantial worth you exported.

How to Save Registry Entries

saving-a-key-to-a-registry-file-in-windows

If you already person a registry record aliases immoderate different matter file, you tin adhd keys to it utilizing Command Prompt and nan reg save command, which will overwrite nan record pinch nan caller information. You conscionable request to specify nan sanction of nan cardinal and nan registry record you want to prevention it to. Here's an example:

reg prevention HKLM\SOFTWARE\MyNewKey2 C:\Users\CHIFUNDO\Desktop\MyRegFile.hiv /y

The /y move astatine nan extremity of nan bid supra overwrites nan record you're redeeming nan cardinal to without bringing up a prompt. When you unfastened nan file, you won't beryllium capable to publication nan contents since it will beryllium saved arsenic a binary file.

How to Restore Registry Entries

restoring-a-registry-key-in-command-prompt

So, let's opportunity thing has happened to nan keys and values wrong nan MyNewKey2 we saved successful nan erstwhile section, you tin usage nan backup record you created to reconstruct it. You'll request to usage nan reg restore command. Here's really to tally it:

reg restore HKLM\SOFTWARE\MyNewKey2 C:\Users\CHIFUNDO\Desktop\MyRegFile.hiv

Now nan MyNewKey2 cardinal should return to nan authorities it was successful erstwhile you made nan backup.

Tweak nan Registry Without nan Registry Editor

While Command Prompt can't do everything nan Registry Editor does, it does connection a speedy measurement to edit nan registry without opening nan aforementioned tool. While utilizing Command Prompt to tweak nan registry is rather advanced, moreover if you're nan mean user, you should beryllium capable to get by if you travel on closely.

Just don't hide to do what we mentioned earlier to debar permanently ruining your Windows machine and create a strategy reconstruct constituent first

Source Tutorials
Tutorials