REGEDIT.exe 使用

写在前面

我自己的注册表导出xxx.reg文件后的内容示例:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE]
"ServiceLastKnownStatus"=dword:00000002

[HKEY_LOCAL_MACHINE\BCD00000000]

[HKEY_LOCAL_MACHINE\BCD00000000\Description]
"KeyName"="BCD00000000"
"System"=dword:00000001
"TreatAsSystem"=dword:00000001

[HKEY_LOCAL_MACHINE\BCD00000000\Objects]

[HKEY_LOCAL_MACHINE\BCD00000000\Objects\{06db8ac5-78d2-11ec-b083-806e6f6e6963}]

[HKEY_LOCAL_MACHINE\BCD00000000\Objects\{06db8ac5-78d2-11ec-b083-806e6f6e6963}\Description]
"Type"=dword:101fffff
"FirmwareVariable"=hex:01,00,00,00,5c,01,00,00,04,00,00,00,01,00,00,00,20,00,\
  00,00,84,00,00,00,04,00,00,00,00,00,42,4f,55,00,45,00,46,00,49,00,3a,00,20,\
  00,50,00,58,00,45,00,20,00,49,00,50,00,76,00,34,00,20,00,52,00,65,00,61,00,\
  6c,00,74,00,65,00,6b,00,20,00,50,00,43,00,49,00,65,00,20,00,47,00,42,00,45,\
  00,20,00,46,00,61,00,6d,00,69,00,6c,00,79,00,20,00,43,00,6f,00,6e,00,74,00,\
  72,00,6f,00,6c,00,6c,00,65,00,72,00,00,00,01,00,00,00,d8,00,00,00,04,00,00,\
  00,02,01,0c,00,d0,41,03,0a,00,00,00,00,01,01,06,00,00,1c,01,01,06,00,00,00,\
  03,0b,25,00,1c,69,7a,fb,a1,a4,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,03,0c,1b,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,7f,ff,04,00,01,04,6c,00,ef,47,64,\
  2d,c9,3b,a0,41,ac,19,4d,51,d0,1b,4c,e6,50,00,58,00,45,00,20,00,49,00,50,00,\
  76,00,34,00,20,00,52,00,65,00,61,00,6c,00,74,00,65,00,6b,00,20,00,50,00,43,\
  00,49,00,65,00,20,00,47,00,42,00,45,00,20,00,46,00,61,00,6d,00,69,00,6c,00,\
  79,00,20,00,43,00,6f,00,6e,00,74,00,72,00,6f,00,6c,00,6c,00,65,00,72,00,00,\
  00,7f,ff,04,00

[HKEY_LOCAL_MACHINE\BCD00000000\Objects\{06db8ac5-78d2-11ec-b083-806e6f6e6963}\Elements]

[HKEY_LOCAL_MACHINE\BCD00000000\Objects\{06db8ac5-78d2-11ec-b083-806e6f6e6963}\Elements\12000004]
"Element"="UEFI: PXE IPv4 Realtek PCIe GBE Family Controller"

 

 

REGEDIT

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.REGEDIT Windows 命令行工具用于从文本中导入、导出或删除注册表设置。让我们用下面的语法详细了解这个命令。

CMD Line

CMD Line is a text-based interface that transfers the command from the user to the OS.CMD Line 是基于文本的界面,可将命令从用户传输到操作系统。

CLI-Command Line InterpreterCLI-命令行解释器

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 entered previously, and then the user can proceed with the following command line that shows up.Windows 的命令行解释器 (CLI) 是 CMD.EXE。此外,您可以使用 PowerShell,它可以自动执行许多系统管理任务,而这些任务在命令提示符下是无法完成的。在 CLI 的帮助下,您可以通过在命令中键入文本来与系统通信。因此,您的系统会回答您之前输入的文本,然后用户可以继续执行以下显示的命令行。

To open the Run command Window.打开运行命令窗口。

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.运行命令窗口可帮助您运行程序、打开文件和文件夹。并且有几种方法可以打开运行命令对话框。此运行命令框有助于您快速直接进入指定程序。

More Commands:   MKLink Command: Creates A Symbolic Link更多命令:MKLink 命令:创建符号链接

By using the Keyboard shortcut Key:通过使用键盘快捷键:

WINDOWS+R视窗+R

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.运行命令框的快捷键方法是最常用的一种。此外,此方法适用于所有版本的 Windows。如果您同时按下 Windows+ R 键以打开“运行”命令对话框,将会有所帮助。

Run command boxRun command box运行命令框

What does the REGEDIT command do?REGEDIT 命令有什么作用?

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.REGEDIT windows 命令行工具用于导入和导出注册表设置。此命令行工具的工作是导入、导出或从文本中删除注册表设置。

Syntax句法

  • Code to Export the Registry导出注册表的代码
Codes:代码:
1
REGEDIT /E pathname
REGEDIT /E 路径名
  • Export Part of the Registry导出部分注册表
Codes:代码:
1
REGEDIT /E pathname "RegPath"
REGEDIT /E 路径名“RegPath”
  • Code to Export part of the Registry in ANSI mode以 ANSI 模式导出部分注册表的代码
Codes:代码:
1
REGEDIT /A pathname "RegPath"
REGEDIT /A 路径名“RegPath”
  • Code to Import a reg script导入 reg 脚本的代码
Codes:代码:
1
REGEDIT pathname
REGEDIT 路径名
  • For silent import对于静默导入
Codes:代码:
1
REGEDIT /S pathname
REGEDIT /S 路径名
  • Code to start the regedit GUI启动 regedit GUI 的代码
Codes:代码:
1
REGEDIT
注册
  • Code to Open multiple copies of regedit打开多个regedit副本的代码
Codes:代码:
1
REGEDIT /m
注册/米

Parameter Explanation参数说明

  • /E– For Export/E– 用于出口
  • /S– This key is to Silent Import/S– 此键用于静默导入

If you execute this command on the command prompt, the output will be as如果在命令提示符下执行此命令,输出将如下

REGEDITREGEDIT注册

Adding Values to the Registry向注册表添加值

  • To add values to the registry, create a text like要将值添加到注册表,请创建如下文本
Codes:代码:
1
2
3
4
Windows Registry Editor Version 5.00 Windows
注册表编辑器版本 5.00
 
[HKEY_CURRENT_USER\SomeKey][HKEY_CURRENT_USER\SomeKey]
"SomeStringValue"="Hello"
"SomeStringValue"="你好"

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.注意:注册表文件名应该是完整的形式,而不是像 (HKLM, HKCU) 这样的短形式。双击此特定文件时,我们将添加注册表项,否则您可以从命令行执行 Myfile.REG。

GPUPDATE Command: Updates Group Policy SettingsGPUPDATE 命令:更新组策略设置

Deleting values from the Registry从注册表中删除值

  • To delete a value from the registry, First, create a reg file like要从注册表中删除一个值,首先,创建一个 reg 文件,如
Codes:代码:
1
2
Windows Registry Editor Version 5.00
Windows 注册表编辑器版本 5.00
[-HKEY_CURRENT_USER\SomeKey] [-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.查找第一个括号内的连字符。双击时,一些键将与值和全部一起删除。如果您只想删除值,请在此处设置要删除的值。我们要删除连字符。
More Commands:   BROWSTAT Command: Get a Domain, Browser, and PDC Info更多命令:BROWSTAT 命令:获取域、浏览器和 PDC 信息

For Instance 例如

Codes:代码:
1
2
3
Windows Registry Editor Version 5.00 Windows
注册表编辑器版本 5.00
[HKEY_CURRENT_USER\SomeKey][HKEY_CURRENT_USER\SomeKey]
"SomeStringValue"=-
“一些字符串值”=-

By double-clicking, you can delete the value.通过双击,您可以删除该值。

Elevated Permissions.提升权限。

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.Regedit 需要提升权限,而在 HKCU 权限中添加项目是必需的。之后,REGEDIT 将允许您使用整个注册表。

Exporting Registry key to a text将注册表项导出到文本

  • To export the registry key to a text file将注册表项导出到文本文件
Codes:代码:
1
regedit /e export.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Audio
regedit /e export.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Audio
  • In ANSI text formatANSI 文本格式
Codes:代码:
1
regedit /A ansi.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Audio
regedit /A ansi.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Audio

Comparing比较

By opening several copies of Regedit.exe, you can compare keys between two registries or between two computers.通过打开 Regedit.exe 的多个副本,您可以比较两个注册表之间或两台计算机之间的密钥。

Drag and Drop拖放

Drag and drop can be utilized when connected to a remote registry, allowing you to apply a .reg file to a remote machine.连接到远程注册表时可以使用拖放功能,允许您将 .reg 文件应用到远程计算机。

Adding Comments添加评论

Comments are prefixed with a semicolon within a registry file 注释在注册表文件中以分号为前缀

For instance,例如,

Codes:代码:
1
2
3
4
5
;;
; Turn the NUMLOCK on at login;登录时打开 NUMLOCK
;;
[HKEY_CURRENT_USER\Control Panel\Keyboard]
[HKEY_CURRENT_USER\控制面板\键盘]
"InitialKeyboardIndicators"="2"“初始键盘指示器”=“2”

Note: Batch files do not consider semicolons to be utilized in a self-contained registry script.注意:批处理文件不考虑在独立的注册表脚本中使用分号。

posted @ 2022-03-20 16:09  bonelee  阅读(1043)  评论(0编辑  收藏  举报