Difference between revisions of "Adding Registry Settings"
(added stub information for regini.exe) |
(→RegEdit) |
||
| Line 2: | Line 2: | ||
Windows has a registry editing program called RegEdit which can be used interactively or it can be scripted. This can be useful to setup defaults for applications, or apply [http://www.winguides.com/registry/ registry tweaks for various Windows settings]. | Windows has a registry editing program called RegEdit which can be used interactively or it can be scripted. This can be useful to setup defaults for applications, or apply [http://www.winguides.com/registry/ registry tweaks for various Windows settings]. | ||
| + | NB: When used via the command line Regedit cannot change registry access permissions. | ||
To run RegEdit interactively, run the program <code>regedit.exe</code>. | To run RegEdit interactively, run the program <code>regedit.exe</code>. | ||
Revision as of 12:19, 17 November 2010
RegEdit
Windows has a registry editing program called RegEdit which can be used interactively or it can be scripted. This can be useful to setup defaults for applications, or apply registry tweaks for various Windows settings. NB: When used via the command line Regedit cannot change registry access permissions.
To run RegEdit interactively, run the program regedit.exe.
To script the amendment of the registry using RegEdit, use it in the form regedit.exe /s <filename>.reg.
You can use RegEdit from WPKG to silently import registry settings, for example:
<package
id="sample_registry"
name="Adds the contents of a .reg file to the registry"
revision="1"
priority="0"
execute="once">
<check type="registry" condition="equals" path="HKEY_LOCAL_MACHINE\SOFTWARE\Test" value="1" />
<install cmd='regedit /s "%SOFTWARE%\test_registry.reg"' />
</package>
And the sample file:
test_registry.reg:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Test]
"Test Setting"=dword:00000001
[-HKEY_LOCAL_MACHINE\SOFTWARE\TEST2]
(In Windows 2000/XP, adding "-" in front of a key name causes that key to be deleted from the registry.)
You can create ready-made .reg files by exporting registry keys from within RegEdit.
Reg
Alternatively, included with Windows 2000 Resource Kit, or with Windows XP itself, there is a command line registry editor, reg.exe, that can be used more directly from the command-line. For example:
REG ADD HKLM\SOFTWARE\Test /v "Test Setting" /d "1" /t REG_DWORD
Regini
You can modify registry entries and permissions with Regini.exe .
The Regini.exe utility is included in the Windows NT Server 4.0 Resource Kit, in the Microsoft Windows 2000 Resource Kit, and in the Microsoft Windows Server 2003 Resource Kit.
Please see the MS KB article for details: Microsoft KB article 264584