Link to home
Start Free TrialLog in
Avatar of Marcelito
Marcelito

asked on

Problem with NT registry....


Hi all:

I have a problem with an application that read a value from NT registry. If the NT user is belongs to Administrators group, the application read the value prefect, but when the user is not belongs to Admin. group, the application can not find the value.
I´m using TRegIniFile, but if use TRegistry is the same....

Any idea?

Thanks
Avatar of inthe
inthe

Hi
see here :
http://www.maxoutput.com/
there is a component(free unit) to replace registry unit for reading values when not administrator..


Regards Barry
note ,
you will still not be able to write to some keys when not admin(this is nt security reasons)but you should be able to read them all with this .
Avatar of Marcelito

ASKER

Thanks Barry, but I cannot install this version of component. It´s for Delphi 3 and the PAS file is not included in the zip. Do you have any notice about a newer version of NTReg component?

Regards, Marcelo
hehe
i guess you didnt see the link to the source pas file ;-)
it is also on the page in the description about tntregistry.
the link "Here" you will see in description.

nevermind here is direct link:

http://www.maxoutput.com/ntreg.pas

i have installed in d4 and only had to change a couple of integers to cardinals if i remember right..

Regards Barry

Save yourself the trouble and use TRegistry.OpenKeyReadOnly instead of TRegistry.OpenKey.

No messing around with an additional component you don't need!

Cheers,

Raymond.
Thanks inthe, and sorry (I´m not see the link "here"). Any way, when I use the unit, I received an "Access Violation" error at creation of object.
I was looking and the problem appears in the method SetRootKey (the property RootKey is inaccesible)

Regards, Marcelo
Hi!

Barry: I fix a problem in my code. The component works perfect. Please, send the answer again and I give you the points. Thanks again.

rwilson: Your solution works also! Thanks for the feedback. I send an ask for you, send me an answer and I give your points!

Thanks all!
ok cheers ;-)

if you only want to read the registry you can use raymonds solution but if you ever need to write to the nt registry then you will need this component for most keys when not logged in as admin.
Regards Barry
ASKER CERTIFIED SOLUTION
Avatar of inthe
inthe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial