Batch operation registry tutorial (below)

Source: Internet
Author: User

Article from: http://wenku.baidu.com/view/ead0ab6fb84ae45c3b358cc2.html

V. Reg Export

Description: Creates a copy of the specified sub-item, item, and value to a file to transfer it to another server.

Syntax:

Reg export keyname filename

Parameters:

Keyname specifies the full path of the subitem. The export operation can only work on a local computer. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, hkcu, hkcr, HKU, and HKCC.

Filename specifies the name and path of the file to be exported. The file must have the. Reg extension.

Note:

The following table lists the return values of the reg export operation. Value description

0 successful

1 failed

Example:

The following example shows how to use the reg Export command:

Reg export "hkcu \ Software \ Microsoft \ winmine" C: \ data \ regbackups \ wmbkup. Reg

Vi. Reg Import

Description: Copies the file containing the exported registry subkeys, keys, and values to the registry of the local computer.

Syntax:

Reg import filename

Parameters:

Filename specifies the name and path of the file to be copied to the registry of the local computer. You must use the reg Export command to create the file in advance.

 

Note:

The following table lists the return values of the reg import operation. Value description

0 successful

1 failed

Example:

The following example shows how to use the reg import command:

Reg import hkcu \ Software \ Microsoft \ winmine "C: \ data \ regbackups \ wmbkup. Reg

VII. Reg Load

Description: writes the saved subkeys and items back to different subkeys in the registry. The purpose is to save it to a temporary file, which can be used to answer the registry key or edit the registry key.

Syntax:

Reg load keyname filename

Parameters:

Keyname indicates the full path of the sub-item. For remote computers, please include the computer name before the sub-path in \ computername \ pathtosubkey. If computername is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, hkcu, hkcr, HKU, and HKCC.

Filename specifies the name and path of the file to be loaded. You must use Reg save with the. HIV extension to create the file.

Note:

The following table lists the return values of the reg load operation. Value description

The following table lists the return values of the reg load operation. Value description

0 successful

1 failed

Example:

The following example shows how to use the reg load command:

Reg load "hkcu \ Software \ Microsoft \ winminebk2" wmbkup. HIV

VIII. Reg Query

Description: return the items under the subkeys of the Registry and the list of subkeys of the next layer.

Syntax:

Reg query keyname [{/V entryname |/ve}] [/S]

Parameters:

Keyname indicates the full path of the sub-item. For remote computers, please include the computer name before the sub-path in \ computername \ pathtosubkey. If computername is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, hkcu, hkcr, HKU, and HKCC. If you specify a remote computer, you can only use the HKLM and HKU subdirectory trees.

/V entryname returns a specific item and its value. This parameter only returns items directly located in the next layer of the specified subitem. The items in the subitem under the current subitem cannot be found. If entryname is omitted, all items under the subitem are returned.

/Ve specifies that only items with null values are returned.

/S returns all the sub-items and items in each layer. If this parameter is not used, only the subitem and item of the next layer are returned.

Note:

The following table lists the return values of the reg query operation. Value description

0 successful

1 failed

Example:

The following example shows how to use the reg query command:

Reg query "HKLM \ System \ CurrentControlSet \ Control \ Session Manager"/V maxstacktracedepth

Reg query "hkcu \ Software \ Microsoft \ winmine"/s

IX. Reg restore

Description: writes the saved subitem and item back to the Registry.

Syntax:

Reg restore keyname filename

Parameters:

Keyname specifies the full path of the subitem. The restore operation only works on the local computer. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, hkcu, hkcr, HKU, and HKCC.

Filename specifies the name and path of the file that will be written back to the Registry. The file must be created in advance using the reg save operation with the. HIV extension.

Note:

This operation overwrites the edited registry key. Before editing the registry key, use Reg save to save the parent key. If the editing fails, you can use this operation to restore the subitem.

This operation overwrites the edited registry key. Before editing the registry key, use Reg save to save the parent key. If the editing fails, you can use this operation to restore the subitem.

The following table lists the return values of the reg restore operation. Value description

0 successful

1 failed

Example:

The following example shows how to use the reg restore command:

Reg restore "hkcu \ Software \ Microsoft \ winmine" wmbkup. HIV

10. Reg save

Description:

Save a copy of the specified subitem, item, and registry value to the specified file.

Syntax:

Reg save keyname filename

Parameters:

Keyname

The full path of the sub-item. For remote computers, please include the computer name before the sub-path in \ computername \ pathtosubkey. If computername is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, hkcu, hkcr, HKU, and HKCC.

Filename specifies the name and path of the created file. If no path is specified, the current path is used.

Note:

The following table lists the return values of the reg save operation. Value description

The following table lists the return values of the reg save operation. Value description

0 successful

1 failed

Example:

The following example shows how to use the reg save command:

Reg save "hkcu \ Software \ Microsoft \ winmine" wmbkup. HIV

11. Reg unload

Description: use Reg load to delete some loaded registries.

Syntax:

Reg unload keyname

Parameters:

Keyname indicates the full path of the sub-item. For remote computers, please include the computer name before the sub-path in \ computername \ pathtosubkey. If computername is ignored, operations on the local computer are performed by default. Start with the corresponding subdirectory tree path. The valid subdirectory trees are HKLM, hkcu, hkcr, HKU, and HKCC.

Note: The following table lists the return values of the reg unload operation. Value description

The following table lists the return values of the reg unload operation. Value description

0 successful

1 failed

Example:

The following example shows how to use the reg unload command:

Reg unload "hkcu \ Software \ Microsoft \ winminebk2"

Be careful

Improper registry editing may seriously damage your system. Back up any valuable data on the computer before changing the registry.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.