The REGEDIT ** windows command-line tool is to **import, export, or remove registry settings from a text. Let’s see about this command in detail with its syntax below.
CMD Line is a ** text-based interface** that transfers the command from the user to the OS.
The command-line interpreter (CLI) for windows is CMD.EXE. Also, you can use PowerShell, which can automate many system administration tasks and these tasks are not approachable in command prompt. With the help of the CLI, you can communicate with your system by typing the text in commands. As a result, your system answers to the text that you have typed previously, and then the user can proceed with the following command line that shows up.
*Run command window * helps you to run programs, open the files and folders. And there are several ways to open up the run command dialogue box. This run command box is helpful for you to head straight to the destined program quickly.
By using the Keyboard shortcut Key:
The shortcut key method to the run command box is the most commonly used one. Also, this method is in all versions of Windows. It would help if you pressed the Windows+ R ** ** key concurrently to open the Run command dialogue box.
The REGEDIT windows command-line tool is to import and export registry settings. The job of this command-line tool is to import, export, or else remove registry settings from a text.
- Code to Export the Registry
REGEDIT /E pathname
- Export Part of the Registry
REGEDIT /E pathname "RegPath"
- Code to Export part of the Registry in ANSI mode
REGEDIT /A pathname "RegPath"
- Code to Import a reg script
- For silent import
REGEDIT /S pathname
- Code to start the regedit GUI
- Code to Open multiple copies of regedit
- /E – For Export
- /S – This key is to Silent Import
If you execute this command on the command prompt, the output will be as
- To add values to the registry , create a text like
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\SomeKey] "SomeStringValue"="Hello"
Note : The registry file name should be in full form and not in short form like (HKLM, HKCU). While double-clicking this particular file, we will add the registry key, or else you can execute Myfile.REG from the command line.
- To delete a value from the registry, First, create a reg file like
Windows Registry Editor Version 5.00 [-HKEY_CURRENT_USER\SomeKey]
- Look for the hyphen ** inside the first bracket. While **double-clicking, some keys will be deleted alongside the values and all. If you want ** only the values** removed , set the value that you want to delete here. We want to delete the hyphen.
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\SomeKey] "SomeStringValue"=-
By double-clicking , you can delete the value.
Elevated permissions are needed for the Regedit, while adding items in HKCU permissions is required. After that, REGEDIT will permit you to utilize the whole registry.
- To export the registry key to a text file
regedit /e export.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Audio
- In ANSI text format
regedit /A ansi.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Audio
By opening several copies of Regedit.exe, you can ** compare keys between two registries** or between two computers.
Drag and drop can be utilized when connected to a remote registry , allowing you to apply a .reg file to a remote machine.
Comments are prefixed with a semicolon within a registry file
; ; Turn the NUMLOCK on at login ; [HKEY_CURRENT_USER\Control Panel\Keyboard] "InitialKeyboardIndicators"="2"
Note : Batch files do not consider ** semicolons** to be utilized in a self-contained registry script.
In this guide, we have stated the REGEDIT windows command-line tool with its syntax and examples. If you have any suggestions or questions regarding this article, let us know in the comment section, we will update it to you shortly.
- REGSVR32 Command: Registers/Unregisters a DLL The REGSRV32 windows command-line tool is to register or unregister a DLL.
- REGEDIT Command: Import/Exports Registry Settings The REGEDIT windows command-line tool is to import and export registry settings.
- RECOVER Command: Recovers the damaged file The RECOVER windows command-line tool is to recover the damaged file from a defective disk.
- PsShutdown Command: Shutdown/Reboots the computer The PsShutdown command line shutdowns or else reboots a local or remote computer from the command line.
- ADmodcmd Windows Command: Active Directory bulk modifying Tool We have shown you about the ADmodmd.exe command line that works as an active Directory bulk modify tool.