Determines whether the currently logged on user is a member of the Administrator's group.
There are times when a program needs to perform an operation that requires the current user to have administrative privileges. This function uses a Shell32 API call to query as to whether the user is an administrator, returning 1 for true and 0 for false.
isAdmin = IsUserAnAdmin()ifnot(isAdmin)then n$ ="not "
print "Current user is "; n$; "an administrator"endfunction IsUserAnAdmin()
calldll #shell32, "IsUserAnAdmin",_
IsUserAnAdmin asbooleanendfunction
IsUserAnAdmin() function
Determines whether the currently logged on user is a member of the Administrator's group.