View Single Post
  #2  
Old 27-08-2023, 08:35
crachlow's Avatar
crachlow crachlow is offline
Registered User
 
Join Date: Nov 2017
Location: Eka-burg
Posts: 22
Thanks: 44
Thanked 11 Times in 7 Posts
crachlow is on a distinguished road
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.
Attached Images
File Type: png 2023-08-27_203621.png (245.4 KB, 141 views)
File Type: png 2023-08-27_203650.png (288.9 KB, 136 views)
File Type: png 2023-08-27_204450.png (270.9 KB, 140 views)

Last edited by crachlow; 27-08-2023 at 08:55.
Reply With Quote
The Following User Says Thank You to crachlow For This Useful Post:
audiofeel (27-08-2023)