The Registry Editor may be used from the command line

an article added by: Dessue Mathenes at 12132007


Windows registry :: The Registry Editor may be used from the command line ::

 French | Spanish | Portuguese | Italian | German | Japanese | Chinese | Korean | Russian | Arabic Bookmark and Share

Using the Registry Editor from the Command Line

The Registry Editor may be used from the command line, without user interaction. The commands that the Registry Editor uses include those described below. (Note that not all commands may be available under all operating systems.)

• To import a registry file into the Registry Editor:

  REGEDIT [/L:system] [/R:user] filename1

• To create a registry object from a file:

  REGEDIT [/L:system] [/R:user] /C filename2

• To export a registry (or part of the registry):

  REGEDIT [/L:system] [/R:user] /E filename3 [regpath1]

• To delete part of a registry:

  REGEDIT [/L:system] [/R:user] /D regpath2

Restoring

Restoring is what Joe and Ed on the Learning Channel do to old furniture, right? Well, maybe so, but it's also possible to restore an object in the registry using the Registry Editor. The process is straightforward, although like everything else, you must have something to restore from. As explained above, using Export (in the File menu), you can save a registry object to a file. The file extension is .reg, and it is a really good idea to keep filenames as descriptive as possible. A suggestion: If you have a strong desire to play with the import and export functionality of the Registry Editor, install a practice copy of Windows. Don't do this on a working version at least not a copy of Windows that you, or anyone else, care about. Note When an object is restored, the data overwrites the existing object. It becomes permanent, as everything that the Registry Editor does is immediately written to the registry. Warning More important: When an object is restored, it is written on top of the currently selected object. Make sure that the object you are restoring belongs at the current selection. Again, make sure you name your file well so that you know exactly which object a given file represents. Imagine coming back to a saved file, perhaps weeks later, and trying to restore it without knowing which object it was saved from. Warning Even much more important: Restoring an object may override the read-only mode option it will write to the registry no matter what! Care to guess how I found that out? When an object is restored, the selected object is not renamed, even though the contents of the object are replaced.

Security

Security is paramount in a Windows installation. The registry, just like the NTFS file system, can be protected from unauthorized access. This can be a critical issue, because Windows supports remote registry editing. Note It is possible to make changes to one computer's registry from another computer without the user of the changed computer even knowing that a change has been made (that is, until they see the results of the change).

The Registry Editor supports security modifications. If a hive is not accessible to the Registry Editor, the user is unable to view the hive or change it, depending on the level of access granted by the system. However, the Registry Editor's Edit → Permissions menu selection allows you to change the security attributes for a hive and any keys (if you have sufficient authority to do so). Initially, when you select Edit → Permissions, the Permissions For dialog box is displayed. You set basic security in this dialog box, while you set advanced functionality (permissions, auditing, and owner) in the Advanced Security Settings For dialog box.

Permissions

The currently selected object is displayed along with the current permissions granted. Default permissions are typically, but not always, ones that everyone can read; the Administrator accounts and the system both have full control. The Permissions tab lists the object's name in the dialog box's title bar. To allow the current object to include its parent's permissions, select the check box that says, "Inherit from parent the permission entries that apply to child objects. Include these with entries explicitly defined here." To allow changing permissions for both the selected item and any subkeys it contains, select the check box that says, "Replace permission entries on all child objects with entries shown here that apply to child objects.". You set detailed permissions by clicking the Edit button in the Permissions tab of the Advanced Security Settings For dialog box. This displays the Permission Entry For dialog box. The list box shows the current permissions, organized by name. Select one name (each may be modified separately, or all entries may be cleared using the Clear All button) and set the type of access. The selections include the following:

Full Control Allows the selected user to have complete, unrestricted access

Query Value Allows the selected user to have read access

Set Value Allows the selected user to have write access

Create Subkey Allows the selected user to create a subkey

Enumerate Subkeys Allows the selected user to obtain a list of subkeys contained within the object

Notify Tells Windows XP to notify the owner when the object is modified

Create Link Allows the selected user to create a link to the object from another object

Delete Allows the selected user to delete the object

Write DAC Allows the selected user to modify Discretionary Access Control information

Write Owner Allows the selected user to modify the owner record information

Read Control Combines the standard read, Query Value, Enumerate Subkeys, and Notify permissions

Warning Of course, the standard warnings apply: Do not grant more permission than is necessary to do the job. Understand which permissions are being granted (see the above list) and consider granting permissions temporarily, removing anything granted as soon as it is not necessary.

Auditing

The word auditing, when mentioned with the words government and taxes, generally gets us weak in the knees and starts us sweating profusely. However, auditing registry interaction can be somewhat less troublesome and very beneficial to the user. Auditing, like permissions, is based on users. You set up auditing in the Auditing tab of the Advanced Security Settings For dialog box. For an object that has not had any auditing set, the list will be blank. The first thing to do is to check "Inherit from parent the auditing entries that apply to child objects. Include these with entries explicitly defined here." Next, click the Add button to add new users to the list. In the Select User, Computer, or Group dialog box, you can select both groups and individual users. Select one name in the list box and click the Add button to add that name to the list of names to be audited. Once all names to be audited have been added, click OK. This dialog box also has an Advanced button that provides additional features for specifying an object name.

Set specific permissions in the Auditing Entry For dialog box. The following events may be audited:

Full Control Used to set auditing events (you may select Successful, Failed, or both)

Query Value Audited whenever the user or group in the name list reads the object

Set Value Audited whenever the user or group in the name list writes to the object

Create Subkey Audited whenever the user or group in the name list creates a key

Enumerate Subkeys Audited whenever the user or group in the name list enumerates a list of keys contained within the object

Notify Audited whenever the user or group in the name list does anything that generates a notification to the owner

Create Link Audited whenever the user or group in the name list creates a link to the object from another object Delete Audited whenever the user or group in the name list deletes the object Write DAC Audited whenever the user or group in the name list modifies the Discretionary Access Control information Write Owner Audited whenever the user or group in the name list modifies the owner record information Read Control Audited whenever the user or group in the name list does anything that includes the standard read, Query Value, Enumerate Subkeys, or Notify permissions You can audit for success and/or failure. Either or both may be selected if desired: Successful Whenever a successful operation is done, auditing information is saved. This mode is useful when creating a log of information about changes to the registry. Success auditing can help you go back and determine what changes were made to the registry to try to fix the problem. Failed Whenever an unsuccessful operation is done, auditing information is saved. Whenever security is an issue (any time there is more than one user), failure auditing can help point to attempts to compromise system security. Tip Select audit success for critical objects that shouldn't be changed often. Select audit failure for any object that is security related. Owner I own things; you own things. To keep the records straight, we have titles for cars, deeds for property, and other documents that trace ownership of anything that is nontrivial. With computers, especially Windows XP, ownership is an important thing. I "own" my computer, and probably I don't want you messing with it. When using NTFS, ownership may be set for files. In addition, objects in the registry may have ownership, too. Ownership implies ultimate control: the owner can restrict access, audit, and do whatever he or she wants. In the Registry Editor, the Owner tab in the Advanced Security Settings For dialog box allows you to take "ownership" of a registry object. An object may have more than one owner, and if there are multiple owners, then they each share owner privilege.

The owner of any object may allow or disallow another user from taking ownership; however, once another user has ownership, the original owner's rights are terminated. Note Both the current owner and the system administrator may assign ownership of the object to a user or to the system administrator.

legal disclaimer

Our website is not responsible for the information contained by this article. Web-articles is a free articles resource.
Suggestion: If you need fresh, daily updated content for your website, feel free to use our service. Click here for more information.

related articles

1. A registry that has been backed up using copy or xcopy is restored
Recovering a Copied Registry A registry that has been backed up using copy or xcopy is restored in the opposite manner from which it was backed up. For example, if you have the NTFS file system, then you have to restart the system using your backup copy of Windows XP. FAT and NTFS When restoring a registry on a FAT-based file system running Windows XP, it's necessary to boot DOS, Windows 95/98/Me, or a second copy of Windows XP. If you have a dual-boot installed (either DOS or Windows 95/98/M...

2. The Windows XP Recovery Console is a tool that allows recovery
The Recovery Console The Windows XP Recovery Console is a tool that allows recovery from a number of failures. Previously, all you could do was boot another copy of Windows XP and hack your way around, replacing files, even registry components, in the blind hope that you would somehow fix the problem. With Windows XP, you have two tools to use: the Recovery Console and the Safe Mode feature. The Recovery Console is a powerful, simple (no, that's not an oxymoron!) feature that is supplied with Windows XP, but it i...

3. What the registry is and the terminology used for its various components
Anatomy of the Registry–The Blood, Gore, and Guts Overview In tutorial 1, we talked a little about what the registry is and the terminology used for its various components. In tutorial 2, we covered backing up and restoring the registry. In this tutorial, we will get into more of the details of what actually is in the registry. If you're only interested in how to use (or recover) the registry, but not what the registry is, it's possible to skip this tutorial. However, if you're unsure about this,...

4. The current control set is copied into the Last Known Good control set
When Is the Current Control Set the Last Known Good Control Set? At some point in the boot process, the current control set is copied into the Last Known Good control set. In Windows XP, the process of replacing the Last Known Good control set is done after the initial logon is performed. This allows the system to catch any problems related to the logon process. HKEY_USERS: Settings for Users Let's take a closer look at SIDs. No, despite what you may think, SID is not the kid down the street;...

5. Windows XP uses only one registry editor
Registry Tools and Tips–Getting the Work Done Overview Windows XP uses only one registry editor. Gone are the separate RegEdit and RegEdt32 editors that existed in Windows 2000. No matter which command you enter in Windows XP, RegEdt32 or RegEdit, the same program (RegEdit, which is called the Registry Editor) will run. Windows XP also has a utility called REG that is included as part of the system installation no more needing to install a separate Resource Kit. This tool is run at the comman...

6. The Registry Editor allows you to quickly create
Creating, Renaming, and Deleting Entries The Registry Editor allows you to quickly create, delete, or rename an entry. Entries may consist of keys, subkeys, or value entries. Creating a New Key You can quickly create a new key by following these steps: 1. Select the hive or key in which the new key is to be created. Either right-click the object or select Edit → New, and then select the type of object to create. 2. The Registry Editor creates the new subkey, giving it a default name of N...

7. Several tips come to mind when using the Registry Editor
Tips for Registry Editor Users Several tips come to mind when using the Registry Editor: • First, when saving a hive using Save Key (under the Registry menu), make absolutely sure that the filename saved to is descriptive enough to enable the successful restoration of the hive at a later time. The Registry Editor doesn't check whether a hive being restored is the same hive as the one being replaced. • Second, as with the Registry Editor, be aware that printing can create reports of incredible s...

8. The export function invoked with the command reg export
Export The export function, invoked with the command reg export, exports the registry object specified to a disk file. The object may be a single-level key, such as HKLM\TEMP. Parameters include the name of the key to export and the name (qualified as necessary) of the file to export to. Export is only allowed on the local machine. The command line for export is: REG EXPORT keyname filename As with other registry tools, the registry path to be queried may be a ROOTKEY or a hive, ...

9. Installing Remote Registry Editing on Windows 95
Installing Remote Registry Editing on Windows 95, Windows 98, and Windows Me Note This section addresses the concerns of system administrators working in mixednetworking environments. Though Windows NT Workstation and Windows 2000 Professional have remote registry editing installed already, Windows 95, 98, and Me do not. The installation process is similar on both operating systems, though the source of the necessary drivers differs with each version. You have to install a network service to enable remote regis...