Using Lazarus/Free Pascal, how can I get the user privileges of the user running my program (whether he’s an Administrator, Regular user, or Guest)?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As David says in a comment you can use the
CheckTokenMembershipfunction to determine the membership of an user account.check this sample which runs on FPC and Delphi.
Also you can use the WMI , check the
Win32_UserAccount,Win32_GroupUserandWin32_Groupclasses.