Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
1.0.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdelrhman-AK committed Dec 1, 2023
1 parent eef5f5e commit 2a55616
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions WinPaletter/Program/Users/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,18 @@ public static Bitmap ProfilePicture

if (!OS.WXP)
{
SelectQuery query = new("Win32_UserProfile");
ManagementObjectSearcher searcher = new(query);
ManagementObjectCollection managementObjects = searcher.Get();
try
{
SelectQuery query = new("Win32_UserProfile");
ManagementObjectSearcher searcher = new(query);
ManagementObjectCollection managementObjects = searcher.Get();

foreach (ManagementObject SID in managementObjects.Cast<ManagementObject>()) { FoundSIDs.Add(SID["SID"].ToString()); }
foreach (ManagementObject SID in managementObjects.Cast<ManagementObject>()) { FoundSIDs.Add(SID["SID"].ToString()); }
}
catch
{
foreach (string SID in Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList").GetSubKeyNames()) { FoundSIDs.Add(SID); }
}
}
else
{
Expand Down

0 comments on commit 2a55616

Please sign in to comment.