Recent

Author Topic: TRegistry.CreateKey() does not work - neither with administratation-rights!  (Read 14886 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TRegistry.CreateKey() does not work - neither with administratation-rights!
« Reply #15 on: September 18, 2012, 07:42:51 pm »
Testing gives
Quote
Failed to create key "StorageDevicePolicies"
, no further error messages..
In my test, this code is before the createkey part:
Code: [Select]
if (Registry.OpenKey('\CurrentControlSet\Control', true)) then showmessage('First openkey worked.');so OpenKey fails as well. I'd look into the required syntax and paths for openkey first.

Perhaps a forum search here will give some results.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Lazarus

  • New Member
  • *
  • Posts: 26
Re: TRegistry.CreateKey() does not work - neither with administratation-rights!
« Reply #16 on: September 18, 2012, 07:43:31 pm »
Oh yes, you're right!
A simple mistake  :-[
I forgot the "system" in my path  :o :-\

so embarrasing!
And I thought, Lazarus failed....

Thank you very much, BigChimp!

Greetings,
bastla

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: TRegistry.CreateKey() does not work - neither with administratation-rights!
« Reply #17 on: September 18, 2012, 07:44:43 pm »
No problem, I'm also very good at making simple mistakes ;)
(However, showing more source code or a small test project can work wonders in these cases as you may be making errors in parts you don't expect...)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Lazarus

  • New Member
  • *
  • Posts: 26
Re: TRegistry.CreateKey() does not work - neither with administratation-rights!
« Reply #18 on: September 18, 2012, 07:52:36 pm »
Four eyes see defenitely more than only two :)
And you're right: The mistakes are located where nobody thought of it   ::)...

 

TinyPortal © 2005-2018