RECOMMENDED: Click here to fix Windows errors and optimize system performance

How to Fix Microsoft Security Essentials Error 0x80040154

The error code 0x80040154 can be shown without any prior warnings. Most of the victims of this error says that there systems were working fine during the last session. The error 0x80040154 can present itself with messages related to “Microsoft Security Essentials”. The error also prevents the users from opening or uninstalling the Microsoft Security Essentials.  Keep in mind that error code 0x80040154 can be shown at various stages during the use of Windows for example when you open a mail application or skype etc. but this solution is specifically for the users facing the error either when they turn on their computer or when they try to start Microsoft Security Essentials.

The issue is mainly associated with the Microsoft Security Essentials. Sometimes there might be Antivirus applications conflicting with the Microsoft Security Essentials. Usually even if you uninstall the security applications, they still keep conflicting with other security programs because the installer didn’t properly clean the files. Another reason for this might be an infection that changed the file structure of Microsoft Security Essentials.

The problem can be solved by uninstalling the Microsoft Security Essentials. But sometimes you can’t uninstall the program from Windows Programs and Features so first try the method 1 and then go through all the methods until the Microsoft Security Essentials is uninstalled.

Method 1: System Restore

If the error code 0x80040154 just started showing up on your computer then the most likely cause is that you downloaded some infected software. Even if you don’t remember installing something new on the PC it is still advised to do a System Restore.

Doing a System Restore will revert back your computer to an earlier time. In other words, it will undo the system changes that you made after the time that you are restoring to. So if the error is showing because of something that you installed on the PC, the problem should go away.

  1. Hold Windows Key and press R
  2. Type rstrui.exe and press Enter

  3. Click Next

  4. Now select the restore point that you want to go to. You can see the exact time when the system restore point was created. Select the most recent one
  5. Click Next. (you can also click scan for affected programs to check which programs will be affected by this system restore)
  6. Click Finish then click yes.

Now your computer will restart and take some time to restore. Wait for it to finish.

Note: You can only do the System Restore if you have the System Protection turned on. You cannot restore the system if the System Protection was turned off and the system does not have any previously stored Restore Points.

So if you see a screen like this:

Than that means this method won’t work for you.

Method 2: Uninstall other antimalware programs

Make sure you have uninstalled other antimalware programs like Norton and McAfee etc. on your system. If you haven’t or if you don’t remember whether you installed them or not then follow the steps below

  1. Hold Windows Key and press R
  2. Type appwiz.cpl and press Enter
  3. Locate any antimalware program. If you find one then click it
  4. Click Uninstall

Keep in mind, sometimes the antimalware programs comes pre-installed on the system. Even if you have an inactivated trial installed on your computer, uninstall it.

Note: Sometimes there are some residual files left behind on the system even if you uninstall a program. To remove those, go here and download the cleanup tool for your specific antimalware program (that you just uninstalled). Now run the cleanup tool to clean the residual files.

Method 3: Uninstall Microsoft Security Essentials (Usual way)

If the malware infection has changed the file structure of Microsoft Security Essentials then uninstalling and reinstalling the program solves the problem.

Go here and run the tool. The tool has some updates that fixes the Microsoft Security Essentials without having to uninstall and reinstall the program. Once you are done, check if the system still shows the error.

If the above mentioned tool doesn’t solve the problem then uninstall the Microsoft Security Essentials yourself from the Remove Programs and Features

  1. Hold Windows Key and press R
  2. Type appwiz.cpl and press Enter
  3. Locate Windows Security Essentials and click it
  4. Click Uninstall

Follow the screen instructions to uninstall the program.

Method 4: Remove Microsoft Security Essentials with mseremoval.bat

  1. Hold Windows key and press R
  2. Type notepad and press Enter

  3. Copy and Paste the lines below in the Notepad

cd /d “%ProgramFiles%\Microsoft Security Client”

setup.exe /x

TASKKILL /f /im MsMpEng.exe

TASKKILL /f /im msseces.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_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

EXIT

PRO TIP: If the issue is with your computer or a laptop/notebook you should try using the Reimage Plus Software which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Reimage Plus by Clicking Here
  1. Now click File then select Save

  2. Type “mseremoval.bat” WITH QOUTES in the section File name
  3. Select All Files from the drop down list in the section Save As Type
  4. Click Save and close the Notepad
  5. Go to the location where you saved the Notepad file.
  6. Right click the file and select Run

Wait for the file to finish running. You will be able to see a black windows appear and disappear once it is finished. Now restart your computer and check if error still appears or not. You can reinstall the Microsoft Security Essentials by going to the Microsoft website if you want.

Method 5: Remove Microsoft Security Essentials with Command Prompt

  1. Hold Windows Key and press R
  2. Type regedit.exe and press Enter

  3. Go to this path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Security Essentials. If you don’t know how to do this then follow the below given steps. Perform these steps in the left pane of the window.
    1. Locate and double click HKEY_LOCAL_MACHINE folder
    2. Locate and double click SOFTWARE folder
    3. Locate and double click Microsoft folder
    4. Locate and double click Windows folder
    5. Locate and double click CurrentVersion folder
    6. Locate and double click Uninstall folder

  4. Right click Microsoft Security Essentials and select Delete. Now close the windows
  5. Press Windows Key once and type cmd in the Start Search box
  6. Press CTRL, SHIFT and ENTER simultaneously (CTRL + SHIFT + ENTER)
  7. Type CD C:\program files\microsoft security client\backup\x86 and press Enter if you are using Windows XP. Type CD C:\Program Files\Microsoft Security Essentials\Backup\x86 for 32-bit version or type CD C:\Program Files\Microsoft Security Essentials\Backup\amd64 for 64-bit version and press Enter.
  8. Type exe /u and press Enter

This will uninstall Microsoft Security Essentials. Now check if the system still gives the error.

Method 6: Microsoft Fixit Tool for removing Microsoft Security Essentials

  1. Go here and click on the download
  2. Once downloaded, run the file by going to the folder that you downloaded it (Usually Downloads) and double clicking it.
  3. Select Detect problems and let me select the files to apply
  4. Click Uninstalling
  5. Select Microsoft Security Client (or Essentials) and click Next
  6. Repeat the steps from 2-4 and now select Microsoft Antimalware. Now click Next

Now restart your computer for the changes to save and check if the issue is still there.

Method 7: Reset the system

The last option for you, unfortunately, is resetting the Windows. You need to format the HDD to get rid of the infected software and do a clean install of the Windows. Do not repair the Windows as it might not solve the problem, you have to perform a complete reinstall.

Note: This will erase all the data from your system so proceed on your own risk.

Backup data

Backing up your data is a good way to make your personal files safe but at this point, when you are resetting the Windows to get rid of the malware, it’s not advised to do a backup because your data might already be infected. So back up your files on your own risk.

Go here for instructions to backing up your files.

You can reinstall the Windows with 2 ways. Either use your Windows CD/DVD to install the Windows or use a recovery partition if you don’t have a CD/DVD.

Reinstall from CD/DVD

  1. Insert the Windows Disc in the CD ROM
  2. Restart your computer
  3. Your computer might ask you to press any key to boot from the disc. When it does, press any key or a specific key that the computer is asking for.
  4. Now select Install Now. (If you are asked whether to repair or do a complete install, DO NOT select the repair Windows option as it won’t solve this problem)

Follow the instructions on the screen to install your fresh copy of Windows

Reinstall from Recovery partition

Sometimes the Windows come preinstalled on your computer and you might not have a Windows disc. In that case you have an option to install Windows from recovery partition

Restart your computer and look for an instruction saying press X key to go to boot menu. The X key might be F10, F12 or it can be anything. It depends on the manufacturer.

The instruction will come up when the manufacturer’s logo appears on the screen

When in boot menu, look for something that says boot from recovery. The name might change depending on your manufacturer

You can then select the recovery volume and follow the instructions on the screen. The instructions will vary from brand to brand but if you aren’t sure then go to your manufacturer’s website and look for the instructions to use recovery partition

Once you are done, follow these steps to make sure your system is secure. Do not connect your computer to the internet or do not connect any external drive before following these steps

Turn Windows Firewall On

  1. Hold Windows key and press R
  2. Type firewall.cpl and press Enter

  3. Select Turn Windows Firewall On or Off

  4. Click Turn on Windows Firewall (if it’s not already) from both Public and Private Sections and press Ok

Uninstall other antivirus programs

Follow method 2 to uninstall the programs

Check Windows updates

  1. Hold Windows key and press R
  2. Type wuapp and press Enter

  3. Select Check for updates

Turn on Windows Defender

  1. Press Windows key once
  2. Type windows defender in the Start Search box and select Windows Defender
  3. Make sure it is on and updated. If you aren’t sure, click tools > select Options > select Real-time protection. Make sure the Turn on Real-time protection is checked.

Now your computer should be clean and secure.

PRO TIP: If the issue is with your computer or a laptop/notebook you should try using the Reimage Plus Software which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Reimage Plus by Clicking Here
RECOMMENDED: Click here to fix Windows errors and optimize system performance

About Kevin Arrows

Hi! I'm Kevin. Thank you for reading the article above. I am a certified MCTS (Microsoft Certified Technology Specialist) with over 10 years of experience. I love to address tech issues, and write tech how-to's in a way that it can be followed by everyone.