How to reinstall Windows defender antivirus easily

If you are experiencing problems with Windows defender (“Windows security”) it may help reinstall this protection.

Some users experience problems starting Windows defender after uninstalling antivirus software. Windows defender problems are also too often reported with a Windows defender link error message.

To solve problems with Windows defender, you can reinstall Windows defender. However, although Windows defender is a standard part of Windows 11 and Windows 10, you cannot reinstall this protection through the settings.

If you want to reinstall Windows defender, you need to use PowerShell. This scripting language restores specific Windows functions in the background, including the Windows defender function.

How to reinstall Windows defender antivirus easily

To reinstall Windows Defender, you need administrator rights in Windows. Make sure you are logged in with an administrator account.

Right-click on the Start button. Click on “Windows Terminal (administrator)” or “PowerShell (admin)” from the menu.

Windows Terminal admin

First, we will set PowerShell to a policy so that all scripts can be executed. This will allow the code needed to reinstall Windows defender.

In the PowerShell window, copy and paste the following code:

Set-ExecutionPolicy Unrestricted

Next, copy and paste the following code:

Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

You will now see blue text with lines of code running. Sometimes you will see a red error message in between with the message “Add-AppxPackage : Deployment failed with HRESULT: 0x80073D06, The package could not be installed because a higher version of this package is already installed.“.

This is not a problem at all. It means that the packages being installed are already in use. So the code just continues, waiting for the process to finish.

reinstall windows defender antivirus using powershell

After the code has run put the policy back as it was. Copy and paste the following code:

Set-ExecutionPolicy Default

Now open Windows defender again. You will see that Windows defender antivirus (“Windows security”) has now been successfully reinstalled.

Windows defender antivirus succesfully reinstalled

I hope this has helped you. Thank you for reading!

Learn more: What is Microsoft Defender Application guard?

Leave a Comment

Your email address will not be published.

Scroll to Top