Page 1 of 1 1
Topic Options
#1561 - 2000-02-01 09:06 AM search & replace in the registry
Anonymous
Unregistered


Hallo,

I'm looking for a way to search & replace in the WinNT registry with kixtart. Maybe there is another commandline tool available to do this.

Can anyone offer suggestions on how to perform this task using kixtart?

Top
#1562 - 2000-02-01 01:15 PM Re: search & replace in the registry
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I can't think of any general methods for doing this in kixtart or any other language. You could dump a hive to a txt file & search it but I would try tio think of an alternative solution to the problem.
_________________________
Jack

Top
#1563 - 2000-02-01 05:47 PM Re: search & replace in the registry
Anonymous
Unregistered


Hi,

In the NT Resource Kit there is a tool called Regfind that allows full search and replace on the registry.

Here is the help for it.
usage: REGFIND [-h hivefile hiveroot | -w Win95 Directory | -m \\machinename]
[-i n] [-o outputWidth]
[-p RegistryKeyPath] [-z | -t DataType] [-b | -B] [-y] [-n]
[searchString [-r ReplacementString]]


where: -h specifies a specify local hive to manipulate.
-w specifies the paths to a Windows 95 system.dat and user.dat files
-m specifies a remote Windows NT machine whose registry is to be manipula
ted.
-i n specifies the display indentation multiple. Default is 4
-o outputWidth specifies how wide the output is to be. By default the
outputWidth is set to the width of the console window if standard
output has not been redirected to a file. In the latter case, an
outputWidth of 240 is used.

-p registryPath specifies where to start searching
Valid prefix names for easy access to well known parts of the registr
y are:

HKEY_LOCAL_MACHINE -> \Registry\Machine
HKEY_USERS -> \Registry\Users
HKEY_CURRENT_USER -> \Registry\Users\...
USER: -> HKEY_CURRENT_USER

-t specifies which registry types to look at:
REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ
REG_DWORD, REG_BINARY, REG_NONE
Default is any of the _SZ types

-b only valid with _SZ searches, and specifies that REGFIND should
look for occurrences of the searchString inside of REG_BINARY data.
May not be specified with a replacementString that is not the same len
gth
as the searchString

-B same as -b but also looks for ANSI version of string within REG_BINARY
values.

-y only valid with _SZ searches, and specifies that REGFIND should
ignore case when searching.

-n specifies to include key and value names in the search.
May not specify -n with -t

-z specifies to search for REG_SZ and REG_EXPAND_SZ values that
are missing a trailing null character and/or have a length that is
not a multiple of the size of a Unicode character. If -r is also
specified then any replacement string is ignored, and REGFIND will
add the missing null character and/or adjust the length up to an
even multiple of the size of a Unicode character.

searchString is the value to search for. Use quotes if it contains
any spaces. If searchString is not specified, just searches based on
type.

-r replacementString is an optional replacement string to replace any
matches with.

searchString and replacementString must be of the same type as specified
to the -t switch. For any of the _SZ types, it is just a string
For REG_DWORD, it is a single number (i.e. 0x1000 or 4096)
For REG_BINARY, it is a number specifing #bytes, optionally followed by
the actual bytes, with a separate number for each DWORD
(e.g. 0x06 0x12345678 0x1234)
If just the byte count is specified, then REGFIND will search for all
REG_BINARY values that have that length. May not search for length
and specify -r

When doing replacements, REGFIND displays the value AFTER the replacement

has been. It is usually best to run REGFIND once without the -r switch
to see what will be change before it is changed.

Hope this is what you are after.

Regards

David Gray

Top
#1564 - 2000-02-02 09:53 AM Re: search & replace in the registry
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Thanks for the tip David. I use the Resource kit utilities all the time & I never noticed that little gem. To other who don't have it, I highly recommend the Resource kit - it is a must have & cheap.
_________________________
Jack

Top
#1565 - 2000-02-04 04:27 AM Re: search & replace in the registry
Pierre FREMION Offline
Getting the hang of it

Registered: 2000-01-11
Posts: 66
Loc: Paris, France, Europe, Sun3
Existing commands in Kix for "gardening" with registry are :

loadhive
unloadhive
deltree
existkey
addkey
loadkey
enumkey
savekey
delkey
enumvalue
readvalue
writevalue
delvalue
readtype

some of them are only avaiable in latest version.

HTH

------------------
Comments always welcome.
French native so I apologize for my (mis)use of English!

_________________________
Comments always welcome. French native so I apologize for my (mis)use of English!

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1119 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.058 seconds in which 0.031 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org