|
Hi, i need to know when some (or every, if no other way) keys of the windows' registry are modified or added or removed.
I looked for some kind of hooks but didn't manage to do it...
Is there a way to achieve this ?
thanks
|
|
|
|
|
Alexandre GRANVAUD wrote: Hi, i need to know when some (or every, if no other way) keys of the windows' registry are modified or added or removed.
See RegNotifyChangeKeyValue() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yeah thanks a lot !
|
|
|
|
|
Is Microsoft still hiding that stuff in the documentation?
led mike
|
|
|
|
|
Ok i tried this function but the only thing it does is notifying me something has changed under a specified regkey. But how do i know what exactly changed ?
|
|
|
|
|
Alexandre GRANVAUD wrote: But how do i know what exactly changed ?
You mean what value was changed?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
yes or what subkey was added/removed ... etc
|
|
|
|
|
You'll need to compare before and after "snapshots."
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
that's what i already do but it's very very slow because ineed to compare 2 trees of HKLM\Classes !
no way to get only the things that changed ?
|
|
|
|
|
Alexandre GRANVAUD wrote: no way to get only the things that changed ?
None that I know of.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
so is there a way to extract a .reg (snapshot) at one time, extract another one after and a tool to compare and save another .reg containing the differences ?
|
|
|
|
|
Yes, see RegSaveKey() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
great with this i can do my 2 snapshots (are they .reg files ?)
but how to compare and extract differencies from the 2 snapshots ?
|
|
|
|
|
Alexandre GRANVAUD wrote: (are they .reg files ?)
That's determined by the second argument.
Alexandre GRANVAUD wrote: but how to compare and extract differencies from the 2 snapshots ?
The same way you would compare any two files. For a quick & dirty approach, you could capture the output of fc.exe.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
fc.exe is it included in windows ?
|
|
|
|
|
As far as I know, it's part of the standard installation.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
nice
but the second argument you mentionned is just the filename not the fileformat, i'd need text file format (like .regs are)
|
|
|
|
|
Alexandre GRANVAUD wrote: i'd need text file format (like .regs are)
Which is what RegSaveKey() does.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
no it saves a .dat file which is (i verified it with notepad) a binary file not a text file : a proprietary fileformat
|
|
|
|
|
My bad. I was thinking of the "export" feature of regedit.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
oh it can interest me too
i'd like a commandline export feature from regedit, does it exist ?
|
|
|
|
|
Alexandre GRANVAUD wrote: i'd like a commandline export feature from regedit, does it exist ?
No, regedit does not support command-line arguments.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
is there another way to extract .reg files from commandline ?
|
|
|
|
|
Alexandre GRANVAUD wrote: is there another way to extract .reg files from commandline ?
Other than rolling your own, not that I know of. Using the registry API, it wouldn't be that difficult.
If you are considering doing this for the sole purpose of comparing two registry keys, don't bother writing to disk first. That would be just too much time. Write to some data structure in memory instead.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|