Real'sHowTo AddThis Feed Button
Custom Search

Detect if the current user is a member of the Administrator's groupTag(s): WinAPI/Registry


[W2K/XP ok but not Vista!]
[local function declaration]
FUNCTION boolean IsUserAnAdmin() LIBRARY "shell32.dll"

[powerscript]
MessageBox("Is Admin ?", IsUserAnAdmin())
With Vista,you need to use the LookupPrivilegeValue and AdjustTokenPrivileges APIs, I have no example but if you have one, send it to me!
blog comments powered by Disqus


If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2013
[ home ]