How to Edit the Registry from the Command Line (2024)

Updated: 12/05/2021 by Computer Hope

How to Edit the Registry from the Command Line (1)

Windows users can access and edit the Windows registry through the command line. Review the sections below for the version of Windows on your computer and information about registry edit commands and syntax.

Tip

If you're attempting to edit the registry from the command line because you're unable to get to normal Windows, try first booting to Windows Safe Mode. Then, run Regedit from Safe Mode.

Tip

To open Windows registry in the command prompt, press Windows key+R, type cmd, and press Enter. In the Command Prompt, type regedit and press Enter.

Microsoft Windows XP, Vista, 7, 8, 10, and 11 users

How to Edit the Registry from the Command Line (2)

Microsoft Windows XP and later users can view, edit, and modify their registry from the Command Prompt application using the reg command. See the reg command page for additional information and examples.

Microsoft Windows 95, 98, Me, and 2000 users

Note

The instructions in this section also work for later versions of Microsoft Windows.

By default, Microsoft Windows 95, 98, Me, and 2000 users can import registry files from the command prompt using the Regedit command. Using this command and a registry file containing the proper commands, a user can add, remove, and otherwise edit the registry from the command line.

To import a registry file from the command line, you can use the Regedit command and the name of the file you want to import. For example, if the name of the file was hope.reg, type the following command.

Regedit hope.reg

The file hope.reg could contain the commands necessary to add and remove registry values. Below are examples of registry files to create entries, delete single entries, and a complete folder. To create these files yourself, copy the following examples into an empty .reg file or use notepad or the edit command to create a file using the following commands.

Note

Users running earlier versions of Windows may want to substitute Windows Registry Editor Version 5.00 with REGEDIT4.

The following example adds a ComputerHope folder into the HKEY_LOCAL_MACHINE\Software directory with a string example and data value of data here.

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\ComputerHope]"example"="data here"

To delete a single entry in the registry, add a hyphen (minus) key after the equal sign. For example, if we wanted to delete our string value "example" we created with the above example, we would create the following .reg file.

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\ComputerHope]"example"=-

To delete the folder and all its continents, create a .reg file similar to the following example.

Windows Registry Editor Version 5.00[-HKEY_LOCAL_MACHINE\SOFTWARE\ComputerHope]

Regedit command syntax

REGEDIT [/L:system] [/R:user] [/C] [/R] [/E] [/S] [/C] FILE [registry_key]
/SThe /s or -s Regedit commands can be added to the command to suppress the confirmation box "Are you sure want to add the information in hope.reg to the registry?" when running the command at the command line. For example, using the same command used earlier, you can type: Regedit /s hope.reg and have that registry file immediately imported into the registry.
/EExport the full registry to a file. For example, typing: Regedit /e full.reg would export the full registry to the full.reg file.

This switch can also be used to export individual registry keys. For example, typing: Regedit /e software.reg "HKEY_LOCAL_MACHINE\Software" would export all the values in this folder to the software.reg file.

This switch is not case-sensitive.

/DMicrosoft Windows 95, 98, and Me users can delete registry keys using this switch. For example, typing: Regedit /d "<registry_key>" where registry_key is replaced with the registry key you want to delete would delete that registry key.
/L:SystemSpecify the location of the system.dat registry file under Microsoft Windows 95, 98, and Me. For example, Regedit /L:c:\windows\system.dat c:\system.dat
/R:userSpecify the location of the user.dat registry file under Microsoft Windows 95, 98, and Me. For example, Regedit /L:c:\windows\system.dat c:\system.dat
/CCompress registry file. This switch only works in Windows 98.
How to Edit the Registry from the Command Line (2024)

FAQs

How to Edit the Registry from the Command Line? ›

Open Command Prompt or PowerShell: Press Windows Key + X to open the Power User menu, then select Command Prompt or PowerShell from the list. Type “regedit”: In the Command Prompt or PowerShell window, simply type “regedit” (without quotes) and press Enter.

How to edit registry from cmd? ›

How to edit the Registry from Command Prompt
  1. Open Start.
  2. Search for Command Prompt, right-click the result, and select Run as administrator.
  3. Type the following command to access the help menu and press Enter: reg /?
  4. Confirm the options available with the tool, including:
Oct 26, 2023

How to edit registry remotely command line? ›

Open Registry Editor by executing regedit from any command line interface in Windows, like Command Prompt or the Run dialog box. Go to File > Connect Network Registry. Type into the large empty space the name of the computer you want to remotely access the registry for.

Which command can modify the registry? ›

To make changes to the registry and export your changes to a . reg file, follow these steps: Click Start, click Run, type regedit in the Open box, and then click OK.

How to fix registry using cmd? ›

To fix registry items with SFC, just follow these steps: Step 1: Type cmd or Command Prompt in the search bar. Step 2: Right-click on the Command Prompt and select the Run as administrator to type the cmd. Step 3: In the Command Prompt window, type command 'sfc /scannow' and press Enter.

How to open registry editor using run command? ›

Right-click Start , then select Run. Type regedit in the Open: box, and then select OK.

How do I access the registry from the command-line? ›

To open Windows registry in the command prompt, press Windows key + R , type cmd, and press Enter . In the Command Prompt, type regedit and press Enter .

How to edit registry without regedit? ›

You can edit the Windows Registry with the help of Console Registry Tool or reg.exe. Reg.exe is a command-line utility with which you can perform almost all the task which you otherwise can with regedit.exe.

How to refresh registry using cmd? ›

Refresh the registry with the DynaCacheInvalidation command

To ensure that your registries are refreshed and your updated content is displayed, you can run the DynaCacheInvalidation command. Be sure that the enableRefreshRegistry parameter is set to true .

How do I run registry edit as administrator? ›

Open the Windows Start menu and type Regedit in the search field. Right-click the Registry Editor menu item that appears. 2. Select Run as administrator from the menu that opens.

What is Windows registry command? ›

The registry helps Windows manage and operate your computer, ensuring access to critical resources and helping important programs configure settings. A hierarchical database structure of keys and values makes up the registry.

How do I edit registry files on another computer? ›

Here's how you do it:
  1. Open your Registry Editor. Click your Windows icon, type “regedit” and select regedit.exe from the list of apps.
  2. Select the desired registry hive. There are several different hives which are stored on disk for your operating system. ...
  3. Load the desired registry hive. ...
  4. Unload the hive once you're done.
Mar 11, 2015

How to modify registry key from command line? ›

To add a key to the registry using Command Prompt, you need to use the reg add command while specifying the path to the new key and whether you want to force the operation with the /f switch (this will bypass the need for the confirmation prompt).

How to enable registry editing using cmd? ›

Open Command Prompt or PowerShell: Press Windows Key + X to open the Power User menu, then select Command Prompt or PowerShell from the list. Type “regedit”: In the Command Prompt or PowerShell window, simply type “regedit” (without quotes) and press Enter.

What is registry modification? ›

The registry modifications are the changes to be performed by a generated package during its deployment to the registry on a target PC. Those changes can include keys and values creation or deletion and values modification.

How to clean registry using cmd? ›

Replies (2) 
  1. Open Start and type cmd, right-click on "Command Prompt", and select "Run as administrator".
  2. Run the following commands at the Command Prompt one at a time: dism.exe /online /cleanup-image /scanhealth. dism.exe /online /cleanup-image /restorehealth. ...
  3. Restart the PC and see if the problem is resolved.
Jan 20, 2022

How to edit Windows Registry without regedit? ›

You can edit the Windows Registry with the help of Console Registry Tool or reg.exe. Reg.exe is a command-line utility with which you can perform almost all the task which you otherwise can with regedit.exe.

How to restore registry using cmd? ›

Perform a Registry Restore with the DISM Command
  1. Run cmd.exe with administrator rights.
  2. Run the following command: DISM /Online /Cleanup-Image /ScanHealth.
  3. Wait until the scan process completes.
Oct 30, 2018

Top Articles
Which Consumer Goods Do Americans Buy Most?
If you paid a scammer with a gift card, is your money gone? Maybe not
Jackerman Mothers Warmth Part 3
Dollywood's Smoky Mountain Christmas - Pigeon Forge, TN
What to Serve with Lasagna (80+ side dishes and wine pairings)
No Hard Feelings Showtimes Near Metropolitan Fiesta 5 Theatre
O'reilly's In Monroe Georgia
How Far Is Chattanooga From Here
Irving Hac
My Vidant Chart
B67 Bus Time
OpenXR support for IL-2 and DCS for Windows Mixed Reality VR headsets
Lax Arrivals Volaris
Minecraft Jar Google Drive
Moviesda3.Com
Craigslist Panama City Fl
Wausau Marketplace
10 Fun Things to Do in Elk Grove, CA | Explore Elk Grove
Dragger Games For The Brain
Brbl Barber Shop
Parkeren Emmen | Reserveren vanaf €9,25 per dag | Q-Park
Klsports Complex Belmont Photos
Cowboy Pozisyon
3 Ways to Drive Employee Engagement with Recognition Programs | UKG
Shiny Flower Belinda
Meowiarty Puzzle
Vadoc Gtlvisitme App
Citibank Branch Locations In Orlando Florida
Little Caesars Saul Kleinfeld
Mbi Auto Discount Code
Gyeon Jahee
Http://N14.Ultipro.com
New Gold Lee
20+ Best Things To Do In Oceanside California
Rochester Ny Missed Connections
Eastern New Mexico News Obituaries
Froedtert Billing Phone Number
Encompass.myisolved
World Social Protection Report 2024-26: Universal social protection for climate action and a just transition
Complete List of Orange County Cities + Map (2024) — Orange County Insiders | Tips for locals & visitors
Directions To The Closest Auto Parts Store
Miami Vice turns 40: A look back at the iconic series
COVID-19/Coronavirus Assistance Programs | FindHelp.org
Denise Monello Obituary
Peace Sign Drawing Reference
Academic Notice and Subject to Dismissal
Stosh's Kolaches Photos
A rough Sunday for some of the NFL's best teams in 2023 led to the three biggest upsets: Analysis
Shiftselect Carolinas
Game Akin To Bingo Nyt
Bob Wright Yukon Accident
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 6321

Rating: 4.1 / 5 (62 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.