Uninstalling Microsoft Security Essentials

Technical Level : Intermediate

This article collects a number of solutions for uninstalling Microsoft Security Essentials.

NOTE: If you are attempting to remove MSE after encountering 0x80073b01 and attempts to remove MSE are met with an error regarding permissions and contacting your administrator, your PC is infected and it has modified the file and folder structure preventing proper functioning or removal of Microsoft Security Essentials in order to reinstall it.

You should download Hitman Pro Kickstart on an uninfected computer, copy it to a USB flash drive and use it to repair MSE and remove the root kit virus, ZeroAccess/Sirefef. Instructions and download here: http://www.surfright.nl/en/kickstart


Typically, Microsoft Security Essentials can be removed by going to Control Panel - Programs and running the uninstall there.

However, there are times when this won't work.

Official Solution:

Microsoft has published a knowledgebase article for how to manually remove Microsoft Security Essentials:



The following is the uninstall part of what MS Support provided when responding to an inquiry where uninstalling was a problem and our normally recommended procedures were not working.

Use our FixIt Tool to uninstall Microsoft Security Essentials. 

This tool is designed to fix un-installation issues like, MSE registry issues, removes remnants of Microsoft Security Essentials from your computer.

a. To do this run the FixIt tool from the following links.

b. Click the below link and select Run Now button.


c. After downloading and running for the first time

d. Select Run on small pop-up window and select Run on Internet Explorer-Security Warning Window.

e. Select Detect problems and let me select the files to apply.

f. Select Uninstalling.

g. After detecting problems Select Microsoft Security Client to uninstall and click Next.

h. Repeat the steps from b to f and, this time select Microsoft Antimalware from list to uninstall and click Next.

i. Restart your computer and reinstall Microsoft Security essentials.


If that doesn't work, please proceed with the advanced removal process:

Further down is a set of commands which will be executed automatically in the background. You need to save this file as "mseremoval.bat" on desktop and run that batch file.

msremoval.txt is given at the end of the post - copy and paste into notepad and follow above information

Uninstall and removal of Microsoft Security Essentials files and folders using advanced method

Before proceeding, make sure that you have first attempted to uninstall Microsoft Security Essentials via Control Panel - Programs.

a. Open Notepad

b. Copy the lines between **** MSREMOVAL.TXT ****

c. Paste the copied lines into Notepad

d. In Notepad, select File/Save As

e. In the File Name section, enter the name as "mseremoval.bat" with quotes and click Save.

f. In the Save As Type, select All Files.

g. Right click on mseremoval.bat and select Run.

h. A command prompt window will open, the necessary steps will be performed and then it will pause at the end. You can see and copy the results from there. When you depress any key, the command prompt window will close. Once this window closes you can delete the mseremoval.bat file that you created earlier in these steps

i. Restart the computer and reinstall Microsoft Security Essentials.

**** MSREMOVAL.TXT **** (don't copy this line but do copy everything below)

cd /d "%ProgramFiles%\Microsoft Security Client"

TASKKILL /f /im MsMpEng.exe

TASKKILL /f /im msseces.exe

TASKKILL /f /im MpCmdRun.exe

net stop MsMpSvc

sc delete MsMpSvc

REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MsMpSvc" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Antimalware" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Security Client" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Microsoft Antimalware" /f

REG DELETE "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Run\MSC" /f

REG DELETE "HKEY_CLASSES_ROOT\Installer\Products\4C677A77F01DD614880F352F9DCD9D3B" /f

REG DELETE "HKEY_CLASSES_ROOT\Installer\Products\4D880477777087D409D44E533B815F2D" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Security Client" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{774088D4-0777-4D78-904D-E435B318F5D2}" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{77A776C4-D10F-416D-88F0-53F2D9DCD9B3}" /f

REG DELETE "HKEY_CLASSES_ROOT\Installer\UpgradeCodes\1F69ACF0D1CF2B7418F292F0E05EC20B" /f

REG DELETE "HKEY_CLASSES_ROOT\Installer\UpgradeCodes\11BB99F8B7FD53D4398442FBBAEF050F" /f

REG DELETE "HKEY_CLASSES_ROOT\Installer\UpgradeCodes\26D13F39948E1D546B0106B5539504D9" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4C677A77F01DD614880F352F9DCD9D3B" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\4D880477777087D409D44E533B815F2D" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\11BB99F8B7FD53D4398442FBBAEF050F" /f

REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\1F69ACF0D1CF2B7418F292F0E05EC20B" /f

takeown /f "%ProgramData%\Microsoft\Microsoft Antimalware" /a /r

takeown /f "%ProgramData%\Microsoft\Microsoft Security Client" /a /r

takeown /f "%ProgramFiles%\Microsoft Security Client" /a /r

REM Delete the MSE folders.

rmdir /s /q "%ProgramData%\Microsoft\Microsoft Antimalware"

rmdir /s /q "%ProgramData%\Microsoft\Microsoft Security Client"

rmdir /s /q "%ProgramFiles%\Microsoft Security Client"

REM Stop the WMI and its dependency services

sc stop sharedaccess

sc stop mpssvc

sc stop wscsvc

sc stop iphlpsvc

sc stop winmgmt

REM Delete the Repository folder.

rmdir /s /q "C:\Windows\System32\wbem\Repository"

sc stop



**** MSREMOVAL.TXT **** (don't copy this line but do copy everything above)

Alternate manual removal method #1 that you can try:

The following information was provided by forum user, Aiscer (updated by PrashantKumar96), to assist in removing MSE if using Control Panel/Programs does not work properly:

1. Download the MSE installer for your Operating System from the MSE Home Page. Save it to your Desktop.

2. Open Command Prompt through RUN or Start Search by typing CMD hit enter. If you are using Vista or Windows 7 right click on CMD and select "Run as Administrator".
3. In the Command Prompt console type: CD %USERPROFILE%\Desktop <- Hit ENTER
4. Type: mseinstall.exe /U

[Notice space between ...exe and /U]
5. Hit ENTER and this should uninstall Microsoft Security Essentials.
6. After the uninstall you can now attempt installation. It would be best that you restart your system first after the uninstall.

Alternate manual removal method #2 that you can try:

Note: Editing the registry incorrectly can cause your system to become unusable. Proceed with caution.

You may wish to backup the registry before proceeding - http://windows.microsoft.com/en-US/windows-vista/Back-up-the-registry

Use the Registry Editor to delete the following key from the Registry.

On XP, go to Start, then Run, and type:


Press Enter

On Vista/Windows 7, in the Search box above the Start "orb" type:

    Regedit -don't press enter.

Right click regedit.exe in the results list above and select, "Run as Administrator"

Navigate to:

     HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Security Essentials

by expanding the branches in the left pane until the branch for Microsoft Security Essentials is displayed.

Right click "Microsoft Security Essentials" in the left hand pane and select Delete.

Close the registry editor.



Click on the Start Menu, go to All Programs, Accessories, Command Prompt

A “DOS” window opens

Assuming that your system drive is C: -

At the prompt, type:

    CD C:\program files\microsoft security client\backup\x86

Press Enter


    setup.exe /x

Press Enter

Setup will launch and will uninstall MSE

Vista and Windows 7:

Type command in the search box (above the Start “orb”), do not press enter

In the results list above, under Programs, right click Command.exe and select "Run as Administrator"

Approve the action via the UAC prompt, if it appears.

A “DOS” window opens.

Assuming that your system drive is C: -

At the prompt, type:

     CD C:\Program Files\Microsoft Security Client\Backup\x86  (for 32 bit Windows)

     CD C:\Program Files\Microsoft Security Client\Backup\amd64  (for 64 bit Windows)

Press Enter

At the prompt (c:\Program Files\Microsoft Security Client\Backup\x86> [or amd64>]), type:

     Setup.exe /x

Press Enter

Setup will launch and will uninstall MSE

Special thanks to the following contributors to this article:






See Also:

How do I uninstall antivirus or antispyware programs?

I can't install Microsoft Security Essentials

Getting started with Microsoft Security Essentials

Uninstalling Microsoft Security Essentials From Windows 10 After An Upgrade

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Pretty useful info in the event of having trouble in uninstalling mse.. Are there any useful info regarding uninstalling windows defender in windows8 and windows 8.1?
H.A.V. Aravinda

Windows Defender cannot be uninstalled from Windows 8/8.1. It also cannot be uninstalled from Windows Vista or Windows 7. It is baked into the OS.


Windows Insider MVP (Security)
Thanx for the update.. Learned something there..
H.A.V. Aravinda
Excellent work!!! I tried the solution.  It works 100%. Thanks!
Exceptional work!  Well done!
MVP(7/2012-6/2015),MCSE,MCSA,MCC2011,xCMM,xCAM,A+,Net+,Security Expert, xInfluencer. See Profile.

W10Prox64 Fast 16299rs3; Ofc Insider 1710/8613.1000; Edge,IE11,Chrome.

On XP, Vista and Windows 7 many people have found that the removal process (including that used by Windows Update) does not remove one important registry key if "Microsoft Security Essentials Update Package" is present. This prevents reinstallation of MSE (even midway through Microsoft Update). The registry key to remove depends on the version of MSE, not the version of Windows. At the time of writing the batch file (above) does not remove the offending registry key.


One of many threads which mention this (look for post by fos4X ), though I originally found this key mentioned in a 2011 post by Stephen Boots.



Recent version with graphics from ParashantKumar86:



Information provided "as is" with no warranties or guarantees.
You are right. The following three keys are recommended to be removed for resolving 0x80070645 error code:
  1. [HKEY_CLASSES_ROOT\Installer\UpgradeCodes\1F69ACF0D1CF2B7418F292F0E05EC20B]
  2. [HKEY_CLASSES_ROOT\Installer\UpgradeCodes\26D13F39948E1D546B0106B5539504D9]
  3. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\1F69ACF0D1CF2B7418F292F0E05EC20B]

You may have noticed that 1st and 3rd key are already in the script but 2nd one is not. I have made a suggestion to add 2nd one also. I think it will be approved and then the script will be applicable for 0x80070645 also.

Thanks for pointing it out!

Please come back with the results.
Please mark replies as helpful/answer if they are.

PrashantKumar96     :


Thanks for the nudge. I've made the addition to the BAT file script.



Windows Insider MVP (Security)
Thanks for addition, Sir (and also for accepting the request)! :-)
Please come back with the results.
Please mark replies as helpful/answer if they are.
Could someone explain the purpose of the last line of the msremoval.bat file:

"sc stop"

since it's is syntactically invalid (missing service name before  "stop")

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.


Forum Article Info

Last updated September 18, 2020 Views 259,473 Applies to: