Solved

Getting if UAC is active or not

Posted on 2010-09-14
7
972 Views
Last Modified: 2012-05-10
Is there a way (based on API) to find out is User Account Control active or not (Vista/Win7), and if possible at which of 1-3 levels (on Win7)?
0
Comment
Question by:npaun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 33671328
Vista/Win7:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\SystemEnableLUA - 1 --> enabledEnableLUA - 0 --> disabled
0
 
LVL 42

Expert Comment

by:sedgwick
ID: 33671365
to read registry values in vb, check this post:
http://www.experts-exchange.com/Programming/Misc/Q_20795428.html
0
 

Author Comment

by:npaun
ID: 33671366
thanks. Is it possible to find out at which 1 out of 3 levels at Win7 is UAC set?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:npaun
ID: 33671417
thanks, reading is not a problem: I have a class that incorporates all kinds of methods (based on API) for registry access. Anyway, what about UAC levels at Win7?
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 33671853
You don't have to be concerned with whether UAC is enabled or disabled but only determine that your process is running under the appropriate token.
VB6:                http:Q_24999995.html
VB.NET:           http:Q_25140579.html
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 33671892
registry key: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System

Level #1 To Have UAC Always Notify You:
ConsentPromptBehaviorAdmin - 2
EnableLUA - 1
PromptOnSecureDesktop - 1

Level #2 To Have the Default UAC Notification:
ConsentPromptBehaviorAdmin - 5
EnableLUA - 1
PromptOnSecureDesktop - 1

Level #3 To Have UAC Notify without Dimming Desktop:
ConsentPromptBehaviorAdmin - 5
EnableLUA - 1
PromptOnSecureDesktop - 0

Level #4 To Turn Off UAC Notifications Completely:
ConsentPromptBehaviorAdmin - 5
EnableLUA - 0
PromptOnSecureDesktop - 1

based on this link http://www.sevenforums.com/tutorials/299-user-account-control-uac-change-notification-settings.html
0
 

Author Comment

by:npaun
ID: 33677070
Thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question