locked
Access Denied Reading Registry RRS feed

  • Question

  • Hello. I have been searching everywhere for an answer, but can not find any information on this topic. My problem is that I built an application using the VB. NET 2005 VS compiler and writing my application using VB. NET 2005 (Framework 2.0) language/architecture and every time I try to read HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services key, I receive an Access Denied error. So my question is, what do I need to do to be able to run this application automatically on any machine without having to force the user change his/her configurations? I am looking for a programmatic way to do this, if possible. All help is certainly appreciated. Thanks in advance.
    Saturday, November 3, 2007 9:16 PM

Answers

  • I was told by email to come here and tell the forum if my post was answered and since I am not sure as to how to do that properly, I will tell you in this post that it certainly has not been fully answered. I have no idea what to do with the supplied information, I had a follow up question which was not answered. And, for future reference, if I figure this out (like many before me who have posted to forums asking for the same help and were ignored) when and if I figure out the solution I will not share with the community.

    I know this is sad for the community because this info is in high demand, but if Microsoft does not want to educate the masses and wants to give us crappy explanations, one line comments, and proverbial (not practical) code, then screw the community built upon a foundation of anti-academia; you are on your own, as am I.
    Tuesday, November 6, 2007 9:11 PM

All replies

  • Generally, all users can read this area of the registry.  Make sure to specify RegistryKeyPermissionCheck.ReadSubTree when you open the key if you do not plan to write.

     

    If you need to write to this area of the registry, you need to be an administrator.  In this case, consider adding the code to your installation program.

    Sunday, November 4, 2007 3:17 PM
  • Hey, that might work for me for reading the key, which I have yet to try but will as soon as after work today; however, what code are you speaking of when and if I want to delete one of those keys? I wont ever need to write to it, I just need to read it and perhaps delete it if necessary.  thanks in advance and sorry for my late reply.
    Monday, November 5, 2007 8:01 PM
  • I was told by email to come here and tell the forum if my post was answered and since I am not sure as to how to do that properly, I will tell you in this post that it certainly has not been fully answered. I have no idea what to do with the supplied information, I had a follow up question which was not answered. And, for future reference, if I figure this out (like many before me who have posted to forums asking for the same help and were ignored) when and if I figure out the solution I will not share with the community.

    I know this is sad for the community because this info is in high demand, but if Microsoft does not want to educate the masses and wants to give us crappy explanations, one line comments, and proverbial (not practical) code, then screw the community built upon a foundation of anti-academia; you are on your own, as am I.
    Tuesday, November 6, 2007 9:11 PM
  • Perhaps you have assumed incorrectly:  I do not work for Microsoft.  Therefore Microsoft has not given you a "crappy explanation".

     

    Furthermore, often comments are brief.  This is because the person asking the question should do some experimentation, consult documentation, etc.  If you have additional questions, they tend to be answered in 2 days or less, but no one is required to do so.

     

    As to your original problem, the only operation that an ordinary user can perform on that subkey is read.  You cannot write it or delete it unless your code to do so runs as administrator.

    Wednesday, November 7, 2007 3:27 AM
  • BinaryCoder, I am sorry you took that post as a reply to you. I was not refering to you in that post my friend. I thought your answer was great and it did get me to the solution, so I am forever grateful for that,it has been a real pain and you certainly helped me find it. I was speaking about MSDN and their "crappy explanations" they give us proverbial code and that to me is anti-academia in a nutshell and nothing peeves this guy off more than that! You on the other hand gave me some great insight and I would never bite the hand that feeds me.  Wink

    My findings suggest that I can set permissions for the key I want to operate on, but I think you do indeed need to be the admin to use it, but that is still yet to be confirmed. Just so you don't think of me as simple, I did indeed consult the documentation and it was so vague that I had no other choice but to show up ill prepared. Experimentation is impossible when all you have to equate are proverbial variables having no value, a + b may equal c, but without having plugable numbers that equation is simply theorhetical at best. I am sure you understand my position at this point.

    At any rate, I am in appreciation of your help and I hope I didn't offend you.
    Wednesday, November 7, 2007 9:27 PM