What can the REG.EXE command do in Windows XP?
REG.EXE does almost everything Regedt32 can do, but it allows you to do it from a command line. This can be useful when you want to quickly make a change without opening Regedt32, and it also allows you to embed registry operations in logon scripts and batch files.
Resource Kit to add this tool. You can download REG.EXE from here: Download Free Windows 2000 Resource Kit Tools
You can use REG.EXE by giving it a command from a short list of options (query, add, update, delete, copy, save, backup, restore, load, and unload), followed by one or more optional parameters that the command you specify will interpret.
Querying keys
REG query allows you to query a single key for a single value, or a range of keys for all their values. This provides you with a quick way to check whether a key has the value you think it does, or in fact whether it has any values associated with it at all:
REG QUERY KeyName [/v ValueName | /ve] [/s]
-
KeyName [\\Machine\]FullKey
Machine - Name of remote machine, omitting defaults to the current machine (Note: the REG.EXE help syntax is wrong. You should use \\ and NOT \ as written!)
Only HKLM and HKU are available on remote machines
FullKey - in the form of ROOTKEY\SubKey name
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey - The full name of a registry key under the selected ROOTKEY
-
/v query for a specific registry key
ValueName - The name, under the selected Key, to query
if omitted, all values under the Key are queried
-
/ve query for the default value or empty value name <no name>
-
/s queries all subkeys and values
Example:
C:\WINDOWS>reg query \\srv1\hklm\software\symantec ! REG.EXE VERSION 3.0
HKEY_LOCAL_MACHINE\software\symantec
HKEY_LOCAL_MACHINE\software\symantec\InstalledApps
HKEY_LOCAL_MACHINE\softwaresymantec\LiveUpdate
HKEY_LOCAL_MACHINE\software\symantec\NAVMSE
HKEY_LOCAL_MACHINE\software\symantec\Norton AntiVirus
HKEY_LOCAL_MACHINE\software\symantec\Norton AntiVirus NT
HKEY_LOCAL_MACHINE\software\symantec\Shared Technology
HKEY_LOCAL_MACHINE\software\symantec\SharedDefs
HKEY_LOCAL_MACHINE\software\symantec\SharedUsage
HKEY_LOCAL_MACHINE\software\symantec\Symevent
Adding new keys
REG.EXE add adds new keys and values to the Registry. You can add a value to an existing key, add a new key with no values, or create a new key and a value beneath it. If you try to add a key or value that already exists, REG.EXE will warn you.
REG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f]
Machine Name of remote machine - omitting defaults to the current machine. Only HKLM and HKU are available on remote machines
FullKey ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY
-
/v The value name, under the selected Key, to add
-
/ve adds an empty value name <no name> for the key
-
/t RegKey data types:
[ REG_SZ, REG_MULTI_SZ, REG_DWORD_BIG_ENDIAN, REG_DWORD, REG_BINARY, REG_DWORD_LITTLE_ENDIAN, REG_NONE, REG_EXPAND_SZ ] If omitted, REG_SZ is assumed
-
/s Specify one charactor that you use as the separator in your data string for REG_MULTI_SZ. If omitted, use "\0" as the separator
-
/d The data to assign to the registry ValueName being added
-
/f Force overwriting the existing registry entry without prompt
Examples:
REG ADD \\ABC\HKLM\Software\MyCo Adds a key HKLM\Software\MyCo on remote machine ABC
REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead Adds a value (name: Data, type: REG_BINARY, data: fe340ead)
REG ADD HKLM\Software\MyCo /v MRU /t REG_MULTI_SZ /d fax\0mail Adds a value (name: MRU, type: REG_MUTLI_SZ, data: fax\0mail\0\0)
REG ADD HKLM\Software\MyCo /v Path /t REG_EXPAND_SZ /d %%systemroot%% Adds a value (name: Path, type: REG_EXPAND_SZ, data: %systemroot%) Notice: Use the double percentage ( %% ) inside the expand string
Removing a key
REG delete removes a key or value. When removing a key, it will remove all subkeys and values beneath that key; however, it will ask you to confirm your intentions before it actually deletes anything. As with REG update, you can only delete keys where the ACLs (and/or the remote Registry settings) allow you access.
REG DELETE KeyName [/v ValueName | /ve | /va] [/f]
Machine Name of remote machine - omitting defaults to the current machine. Only HKLM and HKU are available on remote machines
FullKey ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY
-
ValueName The value name, under the selected Key, to delete. When omitted, all subkeys and values under the Key are deleted
-
/ve delete the value of empty value name <no name>
-
/va delete all values under this key
-
/f Forces the deletion without propmt
Examples:
REG DELETE HKLM\Software\MyCo\MyApp\Timeout Deletes the registry key Timeout and its all subkeys and values
REG DELETE \\ZODIAC\HKLM\Software\MyCo /v MTU Deletes the registry value MTU under MyCo on ZODIAC
Copying keys and values
You can use the command to copy a single value or an entire hive from its original location to another; the target location can be on the same machine as the source or on any other machine on the network. This command makes short work out of tasks like copying a standard set of file associations to new machines or tweaking one machine so its configuration matches another.
REG COPY KeyName1 KeyName2 [/s] [/f]
Machine Name of remote machine - omitting defaults to the current machine. Only HKLM and HKU are available on remote machines
FullKey ROOTKEY\SubKey
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY
Examples:
REG COPY HKLM\Software\MyCo\MyApp HKLM\Software\MyCo\SaveMyApp /s Copies all subkeys and values under the key MyApp to the key SaveMyApp
REG COPY \\ZODIAC\HKLM\Software\MyCo HKLM\Software\MyCo1 Copies all values under the key MyCo on ZODIAC to the key MyCo1 on the current machine
Saving and restoring keys
The REGBACK and REGREST utilities allow you to back up and restore entire hives. To save a key and its values, you can use either reg save or reg backup:
REG SAVE KeyName FileName
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key under the selected ROOTKEY
Examples:
REG SAVE HKLM\Software\MyCo\MyApp AppBkUp.hiv Saves the hive MyApp to the file AppBkUp.hiv in the current folder
REG RESTORE KeyName FileName
ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ]
SubKey The full name of a registry key to restore the hive file into. Overwriting the existing key's values and subkeys
You must use REG SAVE to create this file
Examples:
REG RESTORE HKLM\Software\Microsoft\ResKit NTRKBkUp.hiv Restores the file NTRKBkUp.hiv overwriting the key ResKit
Loading and unloading hives
Regedt32 lets you load and unload saved keys as hives immediately beneath HKLM or HKU. The REG.EXE utility gives you the same ability and with the same limitations.
To load a hive, you use the REG load command. Unlike REG restore, REG load loads the hive by adding it with the key name you specify instead of overwriting the key you specify. This makes it possible for you to use REG load to load a saved hive, edit it, and unload it again without making any changes to the rest of your registry. Here's what the command looks like:
REG LOAD KeyName FileName
ROOTKEY [ HKLM | HKU ]
SubKey The key name to load the hive file into. Creating a new key
You must use REG SAVE to create this file
Examples:
REG LOAD HKLM\TempHive TempHive.hiv Loads the file TempHive.hiv to the Key HKLM\TempHive
REG UNLOAD KeyName
ROOTKEY [ HKLM | HKU ]
SubKey The key name of the hive to unload
Examples:
REG UNLOAD HKLM\TempHive Unloads the hive TempHive in HKLM
<!-- google_ad_section_end --><!-- begin ad tag (tile=2) --><!-- begin ad tag (ns.petri;300x250,336x280) -->
分享到:
相关推荐
效果非常明显的提速WindowsXP,已注册表导入方式,一键优化!
JSSCN-REG-HR-FM-0014-001应聘登记表.numbers
XP优化REG XP优化REG XP优化REG
这只是些写的XP系统的优化REG文件罢了,喜欢的人就用下。 内容包括:XP开关机加速文件;打开启动优化功能;关闭Dr.Watson;关闭WebClient服务;关闭程序仅等待1秒;关闭错误报告服务;关闭错误警告服务;关闭停止...
启动XP的路由功能和IP的过滤功能.reg 启动预读和程序预读可以减少启动时间.reg 在BSOD事件中禁用自动重启动.REG 在右键菜单中加入“记事本”打开项.REG 在启动电脑时执行 Defrag 程式.reg 在我的电脑上全部隐藏磁碟...
前端开源库-reg-publish-s3-pluginReg-Publish-S3-Plugin,获取快照图像并将其发布到AWS S3。
一圈启动XP.Reg 是XP 的优化REG文件 导入后能加快XP启动的速度
非常好用的总结,Verilog中-reg和wire-用法和区别以及always和assign的区别
XP优化REG
关闭-Windows-Defender-Antivirus.reg
修改XP注册到用户名和公司组织名.reg修改XP注册到用户名和公司组织名.reg修改XP注册到用户名和公司组织名.reg修改XP注册到用户名和公司组织名.reg修改XP注册到用户名和公司组织名.reg
将IE7-WindowsXP-x86-enu.zip中的IE7-WindowsXP-x86-enu.exe解压到上面得到的目录中,它就是英文版的IE7安装包 3.运行IE7 Standalone Setup.bat,它会通过CMD的方式将IE7-WindowsXP-x86-enu.exe解压并安装,安装...
XP加速启动XP80REG,使XP操作系统加快运行速度,特别对于配置低的机器
对于熟悉8051单片机的朋友来说,刚接触到LPC单片机会对其中多出来的寄存器的含义不甚明确。本文注明了这些寄存器的名称和作用。
stm32 _REG-LED
超级优化XP快速预读启动注册表.reg超级优化XP快速预读启动注册表.reg超级优化XP快速预读启动注册表.reg超级优化XP快速预读启动注册表.reg超级优化XP快速预读启动注册表.reg超级优化XP快速预读启动注册表.reg超级优化...
reg命令参考 Reg命令使用详解.txt
在实际应用中我们会把这条命令和重定向符号(也称为管道符号,一般用> >> ^)结合来实现输入一些命令到特定格式的文件中.这将在以后的例子中体现出来。 2.@ 命令 表示不显示@后面的命令,在入侵过程中(例如使用...
注册表编辑器,同时支持软件跟踪安装,软件卸载,优化管理,磁盘清理,开机启动项管理,功能强大。文件来源于网上,这个可行性未知 ,https://www.appdoze.com/reg-organizer-giveaway/
XP 优 化 七 十 项 REG 文 件,