Dear Blackfire69. Could you clarify about FUserInfo. As you wrote in the examples, this is not quite suitable, at least for Windows 11. Unknown is displayed in it. If this function defines only the administrator from under the built-in account, and the user from the user group, then this is not entirely correct, probably. I tried to determine by type sid like this
Code:
var
UserSidType: Integer;
s1 : String;
...............................
s1 := Copy(UserInfo.SID,42,3)+Copy(UserInfo.SID,45,1);
UserSidType := StrToInt(s1);
if UserSidType > 1000 then
UserSidType := 1001 ;
// SUserType
case UserSidType of
500: UserTypeStr := 'Administrator';
1001: UserTypeStr := 'Standard User';
else
UserTypeStr := 'Unknown';
end;
But @audiofeel says it doesn't work, or it works intermittently.
And if the user, administrator rights? Whereas? Could you clarify this issue.