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.注意:批處理文件不考慮在獨立的注冊表腳本中使用分號。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM