Wednesday, July 27, 2011

Editing Windows Registry !

You must have read my article on Windows Registry which provides beginners details on the Windows Registry. Now I am going to briefly describe how to edit the registry through the Registry files and DOS.
 
Editing and .reg files
 Windows Registry can be edited easily by the registry explorer provided by the Microsoft but the best way to edit registry is by making the registry files or .reg files as they are very helpful when you need to edit registry on some remote system.

 SYNTAX:
                          RegistryEditorVersion (version 6 in Vista and 5 in XP sp2)
                        
                          [Path of the registry root\key]
                         
                         “Name of the key (data holder)”=DATATYPE: VALUE
                         

The Header of the file is the Windows Registry Editor version. This is a very important part of a .reg files as it defines the executable limits related to the various Windows version. For example if you have written RegistryEditorVersion6 , then the registry file will not run on Windows XP and other earlier versions of Windows whereas if you write RegistryEditorVersion5 , then the registry file will run smoothly of all the versions of Windows except Windows 95 & 98.

The second line is to specify the path of the root\key. It’s very important to keep in mind that the registry path of different versions of Windows differ from each other and hence you should keep in mind the registry path structure while making the registry file.

The third line holds the name of the key or the data holder inside the “” and the DATAVALUE (binary, string, Dword etc.) followed by the value which is to be assigned to the key. When you are assigning a string value, then it’s not important to specify the data type and directly writing the value inside the “” will do the job. Put a “-“or hyphen after the = to delete the key.

Using the above syntax you can easily create a .reg file. I would suggest you to start playing with them as it would help you to understand editing of registry through registry files and you might learn something new!!!!

Editing and the Command Prompt:
 All the windows versions are provided with Command Prompt. Windows Vista and Windows XP, both are provided with 2 command prompts, CMD.EXE and COMMAND.COM. Both are a little bit different from each other (especially version) but both can edit the Windows Registry smoothly.
The best way to learn editing registry through Command prompt is through HELP command.
Open Command Prompt and type:
 Reg/?
And you will be presented with the following:
 REG Operation [Parameter List]

   Operation    [ QUERY  | ADD  | Delete  | Copy |
                          SAVE    | LAOD | UNLOAD| RESTORE|
                          COMPARE | EXPORT | IMPORT  | FLAGS  ]

Return Code: (Except for REG COMPARE)

     0 - Successful
     1 – Failed
For help on a specific operation type:
  
    REG OPERATION /?
Examples:
REG ADD
REG COMPARE
REG COPY
REG DELETE
REG EXPORT
REG IMPORT
REG LOAD
REG QUERY
REG RESTORE
REG SAVE
REG UNLOAD
RED FLAGS

While using Command Prompt, you can even edit the registry of a remote system. In this case you will have to include the computer name before the path of the root\key.

SYNTAX:  REG QUERY\computername\pathtosubkey

Editing Registry through Command prompt is a lot difficult and complex and editing through .reg files. The only benefit is that you can use it for troubleshooting your registry or when you have no other means of editing the registry.

According to MICROSOFT, the above registry editing techniques apply to the following windows version:
Microsoft Windows Server 2003, 64-Bit Datacenter Edition
Microsoft Windows Server 2003, 64-Bit Enterprise Edition
Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
Microsoft Windows Server 2003, Enterprise Edition
Microsoft Windows Server 2003, Standard Edition (32-bit x86)
Microsoft Windows Server 2003, Web Edition
Microsoft Windows XP Professional for Itanium-based systems
Microsoft Windows XP Professional for Itanium-based systems
Microsoft Windows XP Home Edition
Microsoft Windows XP Professional
Microsoft Windows XP Professional x64 Edition
Microsoft Windows XP Media Center Edition 2002
Microsoft Windows XP Tablet PC Edition
Microsoft Windows 2000 Advanced Server
Microsoft Windows 2000 Datacenter Server
Microsoft Windows 2000 Professional Edition
Microsoft Windows 2000 Server
Microsoft Windows NT Server 4.0 Standard Edition
Microsoft Windows NT Server 4.0 Enterprise Edition
Microsoft Windows NT Server 4.0, Terminal Server Edition
Microsoft Windows NT Workstation 4.0 Developer Edition
Microsoft Windows 98 Second Edition
Microsoft Windows Small Business Server 2003 Premium Edition
Microsoft Windows Small Business Server 2003 Standard Edition
Microsoft Windows Vista all version’s

Link which can also help you: Tutorial
Should also see: Basics of Registry

No comments:

Post a Comment

C & C are welcome.