If you can’t install the latest updates for your system via the Windows Update utility because you keep seeing the error code 0x800f0845, the solutions in this article will help you get rid of the error.

Run the Windows Update Troubleshooter

The Windows Update Troubleshooter is a dedicated tool that checks for glitches affecting the Windows Update utility. It will go over the services related to Windows Update and try to resolve any application conflicts that might be preventing the tool from running properly. Once you run the Troubleshooter, it will tell you what errors have occurred and allow you to apply the necessary fixes if they are available. To locate the Windows Update Troubleshooter, you have to go through the Windows Settings application.

Follow the steps below to do that:

  1. Click on the Start button, then select the cogwheel icon once the Start menu shows up. You can also use the Windows + I keyboard combination to open the Settings application.
  2. After the home page of Settings opens, click on the Update & Security icon located toward the bottom of the window.
  3. Once the Update & Security interface appears, go to the left pane of the window and click on Troubleshoot.
  4. Now, navigate to the right pane and click on Windows Update.
  5. Once you see the Run the Troubleshooter button under Windows Update, click on it.
  6. The Troubleshooter will now begin to scan for issues plaguing the Windows Update utility.
  7. Once the scan is complete, the Troubleshooter will ask you to apply the recommended fixes if there are any.
  8. Click on the Apply button, then allow the tool to complete the process.
  9. Once the process completes, try updating your PC.

Use the System File Checker tool to detect problematic system files and automatically replace them

It is possible that some system files have gone corrupt or missing and are triggering the error whenever you want to update your system. As you well know, no process runs on your computer without the involvement of system files. To resolve the problem, in this case, you have to run the System File Checker tool to find missing or corrupted system files and replace them automatically.

Since you’re using Windows 10, you will have to run the inbox Deployment Image Servicing and Management tool before you run the System File Checker. The job of DISM is to provide the files that will be used to replace the problematic ones.

The following steps will show you how to run DISM and SFC:

  1. Right-click the Start button and click on Run in the Quick Access menu. If you want to launch the dialog box faster, press the Windows and R keys simultaneously.
  2. After Run opens in the bottom-left corner of your screen, type “CMD” (without the quotes), then hit the Ctrl, Shift, and Enter keys simultaneously.
  3. Click on the Yes button once the User Account Control dialog window pops up and requests permission to run the Command Prompt as an administrator.
  4. Once the Command Prompt window opens in administrator mode, type the line below into the black screen and hit the Enter key to run the DISM tool:

DISM.exe /Online /Cleanup-image /Restorehealth

The command will prompt the DISM tool to fetch the repair files, using the Windows Update utility. However, since the Windows Update client isn’t running properly, you’ll have to use a different repair source. You can use a bootable USB or a Windows 10 DVD. You can also mount a Windows 10 ISO file as a virtual DVD and use it as the repair source. Make sure you note the path to the Windows folder of the repair source that you are using.

Now, use the following line instead:

DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:X:\Source\Windows /LimitAccess

Note that X:\Source\Windows represents the path to the Windows folder in the repair source that you’re using. Replace it accordingly before entering the command.

Wait for the command to fully execute before you move on to the next step.

  1. Now, type “sfc/ scannow” (no quotes) into the Command Prompt and hit the Enter key.
  2. After the command completes, restart your system if you see the completion message that reads, “Windows Resource Protection found corrupt files and successfully repaired them.”
  3. If you see a message that reads, “Windows Resource Protection could not perform the requested operation” instead, then you have to reboot your system in Safe Mode and run the command. If you don’t know how to get into Safe Mode, follow these steps:
  • Click on the Start button, then select the cogwheel icon once the Start menu shows up. You can also use the Windows + I keyboard combination to open the Settings application.
  • After the Settings app opens, click on the Update & Security icon.
  • Once the Update & Security interface shows up, go to the left pane and click on Recovery.
  • Click on Restart Now under Advanced Startup in the right pane.
  • Once you see the Choose an Option screen, click on the Troubleshoot icon.
  • Click on Advanced Options on the Troubleshoot screen.
  • Now, click on Startup Settings once the Advanced Options screen shows up.
  • Click on the Restart Now button when you see the Startup settings screen.
  • After your PC reboots, tap on the number beside Safe Mode or Safe Mode with Networking.
  • Once your PC boots up, run the System File Checker as we’ve shown you above.

Note that your hard drive’s health can affect your system files. If the drive is badly fragmented, your computer might begin to find it difficult to access certain files. In some cases, you might have to deal with bad sectors on your hard disk. To make sure you don’t suffer from this problem, use a tool that will keep your hard disk drive defragmented and in good shape. Auslogics Disk Defrag will do all of that and more.

Restart Windows Update services

There are different services associated with the Windows Update utility, and they make it run properly. It is possible that these services are currently unavailable or inactive. This particular fix involves restarting them to make sure they run as they should. You can either use the Services app or the Command Prompt to restart the services. We’ll be walking you through each and every process.

Going through the Services app:

  1. Right-click on the Start button and select Run from the Quick Access menu. You can also punch the Windows and R keys together to open the Run dialog box.
  2. After Run shows up, type “Services.msc” (no quotes) into the text field and hit the Enter key.
  3. After the Services application opens, locate the following services:
  • Background Intelligent Transfer Service
  • Cryptographic services
  • Windows Update service
  • Application identity service
  1. Right-click each service, click on Properties, and then click on the Stop button. After that, select Automatic in the Startup Type drop-down menu, and then click on OK.
  2. Now, try running the update.

Using the Command Prompt:

  1. Summon the Run dialog box by right-clicking the Start button and selecting Run from the Quick Access menu. You can also use the Windows + R keyboard combo to launch the Run dialog box.
  2. After Run opens, type “CMD” (no quotes), then hit the Ctrl, Shift, and Enter keys simultaneously.
  3. Click on the Yes button once the User Account Control dialog window opens and requests permission.
  4. Once the Command Prompt window opens in administrator mode, type the following lines into the black screen and hit the Enter key after typing each:

net stop bits

net stop wuauserv

net stop appidsvc

net stop cryptsvc

  1. Next, type the following lines and hit Enter after typing each:

net start bits

net start wuauserv

net start appidsvc

net start cryptsvc

  1. After the commands execute, close the Command Prompt and run Windows Update to check for the error.

Scan your entire system for malware

As it turns out, you could be suffering a case of malware infection. Malware programs sabotage a lot of system files. It’s possible that a malware program has corrupted folders and files connected to the Windows Update process. Try scanning your computer and check if that has resolved the problem.

It is important that you run a full scan instead of allowing your antivirus program to run the regular quick scan. The full scan will scour different corners of your system and make sure no stone is left unturned. You can easily go to the Scan menu of your antivirus program to initiate the full scan. If you rely on Windows Security for system protection, follow the steps below to run the full scan:

  1. Open the Start menu and click on the cogwheel above the Power icon. You can also use the Windows + I keyboard combination to launch the Settings application.
  2. Once you see the home screen of the Windows Settings app, click on the Update & Security label, which should be located at the bottom of the page.
  3. After the Update & Security interface appears, go to the left pane and click on Windows Security.
  4. Go to the Windows Security tab and click on Virus & Threat Protection under Protection Areas.
  5. Once the Virus & Threat Protection page of the Windows Security app opens, click on Scan Options.
  6. On the Scan Options interface, select the radio button for Full Scan, and then click on the Scan Now button.
  7. The full scan should be complete in an hour or more, so give the program time to do its job.
  8. After the scan is complete, take the actions recommended by the tool, then reboot your system and check if the error 0x800f0845 is gone.

You can add an extra layer of security to your computer by installing Auslogics Anti-Malware. The tool is a complete malware remover that works alongside other antivirus programs, including Windows Security. It does not cause any kind of conflict.

Release/renew your IP address and flush your DNS cache

The DNS cache contains information that maps alphanumeric, human-friendly domain names to their IP addresses in number form. The cache may accumulate wrong parameters over time or become corrupt. Once this happens, connection problems will begin to occur, and this might be the reason you are experiencing the error code whenever you want to update your system. Resolving the problem involves clearing out all the parameters in the DNS cache so that Windows can start rebuilding it.

After flushing your DNS, the next step we recommend is releasing and renewing your IP address. Your router or internet device normally assigns a particular IP address to your system. If this IP address becomes unavailable or problematic, your system will fail to connect to the internet, which can cause the error code to show up whenever you want to install updates. When this happens, you need to get a new IP address from your router. To do that, you have to run a command that releases the IP address and renews it.

The steps below will show you how to flush your DNS cache and release/renew your IP address:

  1. Open the search text box next to the Start menu by using the Windows + S combo or clicking on the magnifying glass in the taskbar.
  2. Once the search bar opens, type “cmd” (without the quotes) into the text field.
  3. Once the Command Prompt shows up in the results, right-click it, and then click on Run as Administrator.
  4. Click on Yes in the User Account Control confirmation prompt to grant the Command Prompt administrative privileges.
  5. Next, type the command lines below into the Command Prompt and hit the Enter key after typing each line:

Ipconfig /flushdns

Ipconfig /release

Ipconfig /renew

Please note the spaces in the commands.

  • Now, try performing the update.

Reset the Winsock component

The Winsock component handles every input and output request that comes from web-based applications on your computer. It is a DLL file that can be found in the System 32 folder. It transfers information and configurations from different programs to your network interface, which is known as TCP/IP.

The Windows Update process might be halted and the error might come up because the Winsock component contains wrong configurations or is corrupt. You can resolve the issue by resetting it. Note that you have to open a Command Prompt window and enter the appropriate command. The steps below will show you what to do:

  1. Launch the Run dialog box. You can do this by right-clicking the Start button and selecting Run, by searching for Run in the Start menu, or by using the Windows + R keyboard combo.
  2. After Run shows up in the bottom-left corner of your screen, type “CMD” (without the quotes), then hit the Ctrl, Shift, and Enter keys simultaneously.
  3. The User Account Control dialog window will now pop up and request permission to run the Command Prompt as an administrator. Click on the Yes button once this happens.
  4. Once the Command Prompt opens in administrator mode, type the following line into the black screen:

netsh winsock reset

  1. Windows will now reset the Winsock component by replacing the DLL file.
  2. Once the command executes successfully, restart your computer and try updating it.

Reset Windows Update components

Apart from Windows services,  there are other components that make the Windows Update utility work. These include system files and folders and registry keys. The guide below will show you the step-by-step process for resetting those components. Once you reset them, the Windows Update utility should work properly:

Action 1

Summon the Run dialog box by right-clicking the Start button and selecting Run from the Quick Access menu. You can also use the Windows + R keyboard combo to launch the Run dialog box.

Action 2

After Run opens, type “CMD” (no quotes), then hit the Ctrl, Shift, and Enter keys simultaneously.

Action 3

Click on the Yes button once the User Account Control dialog window opens and requests permission.

Action 4

Once the Command Prompt window opens in administrator mode, type the following lines into the black screen and hit the Enter key after typing each:

net stop bits

net stop wuauserv

net stop appidsvc

net stop cryptsvc

 

Action 5.

Now that you’ve stopped the Windows Update services, go to the next line in the Command Prompt and enter the following commands to delete the qmgr*.dat files:

Del “%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat”

Hit the Enter key.

Action 6.

Next, use the command lines below to rename the SoftwareDistribution and Catroot2 folders. Remember to tap the Enter key after typing each line:

Ren %systemroot%\SoftwareDistribution SoftwareDistribution.bak

 

Ren %systemroot%\system32\catroot2 catroot2.bak

 

Action 7.

After that, reset the Windows Update and Background Intelligent Transfer services to their default security descriptors. To do that, type or copy and paste the commands below and hit the Enter key after entering each:

 

sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)

 

sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)

 

Action 8.

Type the following into the Command Prompt and hit Enter to go to the System32 folder:

cd /d %windir%\system32

 

Action 9.

Register all the Background Intelligent Transfer Service components. To do that, type the following lines into the Command Prompt and punch the Enter key after typing each line. There are quite a lot of lines, so take your time and get it right:

 

regsvr32.exe atl.dll

 

regsvr32.exe urlmon.dll

 

regsvr32.exe mshtml.dll

 

regsvr32.exe shdocvw.dll

 

regsvr32.exe browseui.dll

 

regsvr32.exe jscript.dll

 

regsvr32.exe vbscript.dll

 

regsvr32.exe scrrun.dll

 

regsvr32.exe msxml.dll

 

regsvr32.exe msxml3.dll

 

regsvr32.exe msxml6.dll

 

regsvr32.exe actxprxy.dll

 

regsvr32.exe softpub.dll

 

regsvr32.exe wintrust.dll

 

regsvr32.exe dssenh.dll

 

regsvr32.exe rsaenh.dll

 

regsvr32.exe gpkcsp.dll

 

regsvr32.exe sccbase.dll

 

regsvr32.exe slbcsp.dll

 

regsvr32.exe cryptdlg.dll

 

regsvr32.exe oleaut32.dll

 

regsvr32.exe ole32.dll

 

regsvr32.exe shell32.dll

 

regsvr32.exe initpki.dll

 

regsvr32.exe wuapi.dll

 

regsvr32.exe wuaueng.dll

 

regsvr32.exe wuaueng1.dll

 

regsvr32.exe wucltui.dll

 

regsvr32.exe wups.dll

 

regsvr32.exe wups2.dll

 

regsvr32.exe wuweb.dll

 

regsvr32.exe qmgr.dll

 

regsvr32.exe qmgrprxy.dll

 

regsvr32.exe wucltux.dll

 

regsvr32.exe muweb.dll

 

regsvr32.exe wuwebv.dll

 

Action 10.

Now, you’ll have to delete some unnecessary registry keys.

Before you do that, note that editing the registry is a sensitive task and you must follow the steps below carefully. To be safe, back up your registry before applying this fix.

 

Now, follow these steps to remove the unneeded registry keys:

  1. Use the Windows + R keyboard combo to launch Run.
  2. After Run shows up in the bottom-left corner of your screen, type “regedit” (without the quotes), then hit the Enter key.
  3. The User Account Control dialog window will now pop up and request permission. Click on the Yes button.
  4. Once the Registry Editor opens, go to the left pane and drill down to HKEY_LOCAL_MACHINE\COMPONENTS.
  5. Under COMPONENTS, check if the following keys are present and delete them:
  • PendingXmlIdentifier
  • NextQueueEntryIndex
  • AdvancedInstallersNeedResolving

Action 11.

Lastly, go to the Administrator Command Prompt and enter the following lines one after the other to restart the services you stopped earlier:

net start bits

net start wuauserv

net start appidsvc

net start cryptsvc

 

Reboot your PC and try updating your system.

 

Reset your Hosts file

If nothing works, try resetting your Hosts file. The file contains configurations that allow communication in your system’s network infrastructure. The file might be corrupt, or some of its configurations are now wrong. Reset it to the default and check if the error goes away. The following steps will walk you through the process:

    1. Open the search text box next to the Start menu by using the Windows + S combo or clicking on the magnifying glass icon on the taskbar.
    2. Once the search bar opens, type “notepad” (without the quotes) into the text field, and then click on Notepad in the results.
    3. After Notepad opens, copy and paste the text below into the new file:

# Copyright (c) 1993-2006 Microsoft Corp.

#

# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.

#

# This file contains the mappings of IP addresses to host names. Each

# entry should be kept on an individual line. The IP address should

# be placed in the first column followed by the corresponding host name.

# The IP address and the host name should be separated by at least one

# space.

#

# Additionally, comments (such as these) may be inserted on individual

# lines or following the machine name denoted by a ‘#’ symbol.

#

# For example:

#

#      102.54.94.97     rhino.acme.com          # source server

#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.

#       127.0.0.1       localhost

#       ::1             localhost

    1. Click on the File menu and select Save As. You can also press the Ctrl, Shift, and S keys simultaneously.
    2. Once the Save dialog box appears, save the file as Hosts in your Documents folder.
    3. Now, summon a File Explorer window by pressing the Windows and E keys together or by clicking on a folder on your desktop. You can also right-click on the Start button and select File Explorer or click on the folder icon on your taskbar.
    4. After the File Explorer window opens, navigate to C:\Windows\System32\drivers\etc, locate the Hosts file in the ETC folder and rename it to “Hosts.old” (no quotes) or any other name of your choice. If any confirmation dialog pops up, accept it.
    5. Navigate to your documents and move the Hosts file you created earlier into the C:\Windows\System32\drivers\etc directory.
  • If you’re prompted for an administrator password, provide the details and click on Continue.

Conclusion

One of the solutions above will help you get rid of the error. If nothing works, you can go to Microsoft’s website to download and install your updates manually. If you have thoughts that you’d like to share with us, use the comments section below!