How to identify, Is current user a Administrator..?Hi,<br/><br/>Is there any registry key using which I can identify that weather the current user is Administrator or not...<br/>I need to do this so that i can exit my Setup if the current user is not an Admin.<br/><br/>Or recoment me if there is some other way to achieve the same.<br/><br/><br/><br/>Thanks,<br/><hr class="sig">vishwas Srivastava© 2009 Microsoft Corporation. All rights reserved.Mon, 21 Sep 2009 07:00:21 Zac1017e5-ab9b-4647-b1e0-4c58f5e38ce6http://social.msdn.microsoft.com/Forums/en-US/MEFramework/thread/ac1017e5-ab9b-4647-b1e0-4c58f5e38ce6#ac1017e5-ab9b-4647-b1e0-4c58f5e38ce6http://social.msdn.microsoft.com/Forums/en-US/MEFramework/thread/ac1017e5-ab9b-4647-b1e0-4c58f5e38ce6#ac1017e5-ab9b-4647-b1e0-4c58f5e38ce6Vishwas Srivastavahttp://social.msdn.microsoft.com/Profile/en-US/?user=Vishwas%20SrivastavaHow to identify, Is current user a Administrator..?Hi,<br/><br/>Is there any registry key using which I can identify that weather the current user is Administrator or not...<br/>I need to do this so that i can exit my Setup if the current user is not an Admin.<br/><br/>Or recoment me if there is some other way to achieve the same.<br/><br/><br/><br/>Thanks,<br/><hr class="sig">vishwas SrivastavaThu, 21 May 2009 03:57:34 Z2009-05-21T03:57:34Zhttp://social.msdn.microsoft.com/Forums/en-US/MEFramework/thread/ac1017e5-ab9b-4647-b1e0-4c58f5e38ce6#dfb62a0b-5846-4e5a-babd-1640c1f7d11ehttp://social.msdn.microsoft.com/Forums/en-US/MEFramework/thread/ac1017e5-ab9b-4647-b1e0-4c58f5e38ce6#dfb62a0b-5846-4e5a-babd-1640c1f7d11eReed Copsey, Jr.http://social.msdn.microsoft.com/Profile/en-US/?user=Reed%20Copsey%2c%20Jr.How to identify, Is current user a Administrator..?You can get this information from the WindowsPrincipal class.<br/> <br/> Check out <a href="http://www.omegacoder.com/?p=82">this article for a detailed code</a> sample.<br/> <br/> The trick here is in the line: <pre style="border-style:none;margin:0em;padding:0px;overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:'Courier New',courier,monospace;background-color:white">myPrincipal.IsInRole( WindowsBuiltInRole.Administrator ) ? <span style="color:#006080">&quot;True&quot;</span> : <span style="color:#006080">&quot;False&quot;</span> ,<br/> <br/> You can check the current principal to check to see if the current user is an administrator.<br/> </pre><hr class="sig">Reed Copsey, Jr. - <a href="http://reedcopsey.com">http://reedcopsey.com</a>Mon, 25 May 2009 16:44:13 Z2009-05-25T16:44:13Z