Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
-impv code
Greedeksce3c2901415d
diff --git a/.Source/GTweak/Utilities/Configuration/SystemDiagnostics.cs b/.Source/GTweak/Utilities/Configuration/SystemDiagnostics.csindex 7247a0c4..a8df0593 100644--- a/.Source/GTweak/Utilities/Configuration/SystemDiagnostics.cs+++ b/.Source/GTweak/Utilities/Configuration/SystemDiagnostics.cs@@ -68,7 +68,6 @@ namespace GTweak.Utilities.Configurationforeach (string keyname in ourKey!.GetSubKeyNames())regKey = ourKey!.OpenSubKey(keyname);-return new BitmapImage(new Uri(regKey?.GetValue("Image1080").ToString() ?? string.Empty));}catch { return null; }@@ -77,8 +76,9 @@ namespace GTweak.Utilities.Configurationinternal string GetProfileName(){string nameProfile = string.Empty;- foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", $"select FullName from Win32_UserAccount where domain='{Environment.UserDomainName}' and name='{Environment.UserName.ToLower()}'").Get())- nameProfile = (string)managementObj["FullName"];++ foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", $"select FullName from Win32_UserAccount where domain='{Environment.UserDomainName}' and name='{Environment.UserName.ToLower()}'", new EnumerationOptions { ReturnImmediately = true }).Get())+ nameProfile = managementObj["FullName"] as string;return !string.IsNullOrWhiteSpace(nameProfile) ? nameProfile : Environment.UserName.ToLower();}diff --git a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.csindex d86a3898..b20b0a5f 100644--- a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs+++ b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs@@ -6,6 +6,7 @@ using System;using System.ComponentModel;using System.Diagnostics;using System.IO;+using System.Linq;using System.Management;using System.Runtime.InteropServices;using System.Text;@@ -147,7 +148,11 @@ namespace GTweak.Utilities.Tweaksinternal void ViewBluetoothStatus(){- try { isBluetoothStatus = new ManagementObjectSearcher("select DeviceId from Win32_PnPEntity where service='BthLEEnum'").Get().Count > 0; }+ try+ {+ using var managementObj = new ManagementObjectSearcher("SELECT DeviceID FROM Win32_PnPEntity WHERE Service='BthLEEnum'").Get();+ isBluetoothStatus = managementObj.Cast<ManagementObject>().Any();+ }catch { isBluetoothStatus = false; }}