A better choice is to use a tool like
Registry Agent (see ???Search and Replace Registry Data,??? earlier
in this chapter).
There??™s no requirement that the keys in a Registry patch file need to have
lived next to one another in the Registry, or that they be in any particular
order. This means you can combine several separate patch files into one,
and use it to restore any number of keys in one step. All it takes is a little
copy and paste between side-by-side Notepad windows. The only thing
you need to do, besides making sure all the keys and values remain intact,
is to remove any extraneous Windows Registry Editor Version 5.00 header
lines.
If you??™re creating a Registry patch to be used on other PCs, make sure you
fix any references to absolute pathnames before you distribute the file. If,
for example, your patch file references D:\Windows\notepad.exe, it??™ll
cause a problem on any PC where notepad.exe is located in C:\Windows\.
The best solution is to use expandable string values, as described earlier
in this chapter, along with the appropriate system variables, like this:
%SystemRoot%\notepad.exe. Now, since expandable string values are
stored like Binary values in Registry patch files, such an entry would look
like this:
"Open"=hex(2):26,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,\
00,74,00,25,00,5c,00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,\
78,00,65,00,00,00
112 | Chapter 3: The Registry
Now, as you may??™ve guessed, it??™s considerably easier to edit expandable
string (and binary) values in the Registry Editor than in any text editor, so
you??™ll probably want to make such corrections before you export the key to
a patch file.
Pages:
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175