How do I know if the UWF is enabled or disabled? I'm making an application with C # so I need to know for that language.
Thank you
There are few things to keep in mind when considering whether UWF is enabled or disabled:
The C# code below demonstrates the use of CurrentEnabled property of UWF_Filter class:
public static bool IsEnabled()
{
try
{
//root\standardcimv2\embedded
ManagementScope scope = new ManagementScope(@"root\standardcimv2\embedded");
using (ManagementClass mc = new ManagementClass(scope.Path.Path, "UWF_Filter",
null))
{
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
// Please make use of NextEnabled property in case you have enabled the UWF_Filter in the current session.
//The value in CurrentEnabled is populated only when the UWF_Filter was enabled on system boot.
return (bool)mo.GetPropertyValue("CurrentEnabled");
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
return false;
}
Note/Request: Request someone with 1500 reputation to create and link following tags so that it becomes easier for people like me to request solutions/answer questions on stackoverflow.