Post by drcard on Jun 26, 2022 10:01:17 GMT -5
Reset Windows Update to Fix Update Problems
What
Instructions on how to reset Windows Update components to correct update problems that cause the update process to hang or consistently fail at installing updates. This is accomplished by entering commands in an administrator Command Prompt.
Why
Sometimes a Windows update gets stuck in one step of the update process which appears to never finish, or the update fails to install on repeated attempts. This results in other updates not being installed because the update components are locked in to the current hung or damaged update. There are many different component services and files in the Windows update process where the cause of the problem could occur. Rather than trying to find out exactly which service or file is causing the problem, it is easier to reset all the component services connected to the Windows update process and delete all files created during the update failure. This will start the Windows Update afresh and usually corrects the problem that caused the failed update.
Note: These commands will stop Windows Update components, remove any incomplete downloaded and created files, and restart all the Windows Update components. This method is used to fix a problem with the update process and not to prevent a specific update from installing. See Prevent a Windows Update From Installing to prevent an update from installing. Performing all the steps below may not be necessary to fix your Windows Update problems; but since you don’t know exactly which component is causing the problem and needs fixing, following all the steps and resetting all components will fix many different problems.
How
Step 1 – Open an Administrator Command Prompt
Open a Command Prompt with administrative privileges: open a Run box (WinKey + R), type in cmd, press Ctrl + Shift + Enter keys simultaneously, and click Yes to the UAC security window.
Step 2 – Stop Windows Update Services
At the prompt (>) enter each command line below pressing the Enter key after entering that command line to run that command. The system will respond with a message that the service is not running, or that it is stopping that service, and when stopped a message that it has been stopped successfully. You may have to run the command more than once to get the service to successfully stop.
Also notice the spaces between the command words in the commands below. Without the proper spacing in the commands the commands will not work. The commands below have the proper spacing and are suitable for copying and pasting into the Command Prompt.
net stop bits
net stop wuauserv
net stop appidsvc
net stop cryptsvc
net stop msiserver
Shutting down these services allows us to get rid of hung files connected to the services (aka: not in use).
Step 3 – Remove Files for Current Hung/Failed Update
At the prompt (>) enter the following command and press the Enter key. The system will respond with Are you sure? (Y/N) to confirm the deletion, which you enter Y and press the Enter key. The system will not respond and the file is deleted. If the system can’t delete the file it responds with a message as to why such as “The process cannot access the file because it is being used by another process”. This means the service is not stopped (could have turned itself back on) so repeat Step 2 above to stop the service.
Also notice the spaces between the command words in the command below. Without the proper spacing in the command the command will not work. The command below has the proper spacing and is suitable for copying and pasting into the Command Prompt.
Del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\*.*"
This command deletes the data file created by the BITS service during the update process.
At the prompt (>) enter the following commands and press the Enter key after entering each command. The system will not ask for confirmation for removing these files and will not respond if the files are deleted as the command indicated. If the system can’t delete the file it responds with a message as to why such as “The process cannot access the file because it is being used by another process”. This means the service is not stopped (could have turned itself back on) so repeat Step 2 above to stop the service.
Also notice the spaces between the command words in the commands below. Without the proper space in the commands the commands will not work. The commands below have the proper spacing and are suitable for copying and pasting into the Command Prompt.
rmdir %systemroot%\SoftwareDistribution /S /Q
rmdir %systemroot%\system32\catroot2 /S /Q
The above commands will delete all files associated with the hung/failed update. The /S option deletes all files and folders in that folder and the /Q option negates the need to confirm the deletions.
Step 4 – Reset BITS and Windows Update Services Security Descriptors
At the prompt (>) enter the following commands and press the Enter key after entering each command. If enter correctly the system will respond that the SetServiceObjectsSecurity SUCCESS. Make sure you get the SUCCESS response for each service.
It is best to copy and paste each command.
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)
Step 5 – Register all DLL Files Used by BITS and Windows Update Services
At the prompt (>) enter the following command followed by pressing the Enter key. Be sure to include the space between cd and /d and the space between /d and %windir%\system32. The following command is suitable for copy and pasting.
cd /d %windir%\system32
This command will change the directory of the Command Prompt to the Windows System32 folder. If the prompt is already at Windows\System32, no need to run the command to change the directory of the prompt. DLL files are registered with regsvr32.exe which is in the System32 folder. Moving the prompt to the Windows\System32 folder negates the need to enter the full PATH address for regsvr32.exe file in each of the following commands so the prompt must look like this (if Windows is installed on the C:\ drive):
C:\Windows\System32>
for the commands below to register the DLL files.
At the prompt (Windows\System32>) enter each of the following commands to register each DLL file. Press the Enter key after entering the command line. The prompt will return to Windows\System32> ready for the next DLL file to be registered. Register each file one at a time. Be sure to include the space between regsvr.exe and the /s option and the space between the /s option and the DLL file name. The commands below are suitable for copying and pasting into the Command Prompt. If you do get an error message, it most likely will be due to incorrect spelling or spacing in the command entered.
regsvr32.exe /s atl.dll
regsvr32.exe /s urlmon.dll
regsvr32.exe /s mshtml.dll
regsvr32.exe /s shdocvw.dll
regsvr32.exe /s browseui.dll
regsvr32.exe /s jscript.dll
regsvr32.exe /s vbscript.dll
regsvr32.exe /s scrrun.dll
regsvr32.exe /s msxml.dll
regsvr32.exe /s msxml3.dll
regsvr32.exe /s msxml6.dll
regsvr32.exe /s actxprxy.dll
regsvr32.exe /s softpub.dll
regsvr32.exe /s wintrust.dll
regsvr32.exe /s dssenh.dll
regsvr32.exe /s rsaenh.dll
regsvr32.exe /s gpkcsp.dll
regsvr32.exe /s sccbase.dll
regsvr32.exe /s slbcsp.dll
regsvr32.exe /s cryptdlg.dll
regsvr32.exe /s oleaut32.dll
regsvr32.exe /s ole32.dll
regsvr32.exe /s shell32.dll
regsvr32.exe /s initpki.dll
regsvr32.exe /s wuapi.dll
regsvr32.exe /s wuaueng.dll
regsvr32.exe /s wuaueng1.dll
regsvr32.exe /s wucltui.dll
regsvr32.exe /s wups.dll
regsvr32.exe /s wups2.dll
regsvr32.exe /s wuweb.dll
regsvr32.exe /s qmgr.dll
regsvr32.exe /s qmgrprxy.dll
regsvr32.exe /s wucltux.dll
regsvr32.exe /s muweb.dll
regsvr32.exe /s wuwebv.dll
The /s option registers the DLL files without messages or confirmations to help speed up this process.
Step 6 – Reset Your Network Configuration
At the prompt (>) enter the following commands and press the Enter key to run that command. Note the space between the command words in the command line. These commands are suitable for copying and pasting. The system will state that you need to restart the computer to complete the reset, but do not restart until instructed to in the step below.
netsh winsock reset
netsh winsock reset proxy
Step 7 – Restart BITS, Windows Update, and Related Components
Now we restart those services that we stopped in Step 2 above
At the prompt (>) enter each command line below pressing the Enter key after entering that command line to run that command. The system will respond with a message that the service is starting and when started a message that it has been started successfully.
Also notice the spaces between the command words in the commands below. Without the proper spacing in the commands the commands will not work. The commands below have the proper spacing and are suitable for copying and pasting into the Command Prompt
net start bits
net start wuauserv
net start appidsvc
net start cryptsvc
net start msiserver
Once all the services have successfully restarted, restart the computer and the Windows Update should be working again.
What
Instructions on how to reset Windows Update components to correct update problems that cause the update process to hang or consistently fail at installing updates. This is accomplished by entering commands in an administrator Command Prompt.
Why
Sometimes a Windows update gets stuck in one step of the update process which appears to never finish, or the update fails to install on repeated attempts. This results in other updates not being installed because the update components are locked in to the current hung or damaged update. There are many different component services and files in the Windows update process where the cause of the problem could occur. Rather than trying to find out exactly which service or file is causing the problem, it is easier to reset all the component services connected to the Windows update process and delete all files created during the update failure. This will start the Windows Update afresh and usually corrects the problem that caused the failed update.
Note: These commands will stop Windows Update components, remove any incomplete downloaded and created files, and restart all the Windows Update components. This method is used to fix a problem with the update process and not to prevent a specific update from installing. See Prevent a Windows Update From Installing to prevent an update from installing. Performing all the steps below may not be necessary to fix your Windows Update problems; but since you don’t know exactly which component is causing the problem and needs fixing, following all the steps and resetting all components will fix many different problems.
How
Step 1 – Open an Administrator Command Prompt
Open a Command Prompt with administrative privileges: open a Run box (WinKey + R), type in cmd, press Ctrl + Shift + Enter keys simultaneously, and click Yes to the UAC security window.
Step 2 – Stop Windows Update Services
At the prompt (>) enter each command line below pressing the Enter key after entering that command line to run that command. The system will respond with a message that the service is not running, or that it is stopping that service, and when stopped a message that it has been stopped successfully. You may have to run the command more than once to get the service to successfully stop.
Also notice the spaces between the command words in the commands below. Without the proper spacing in the commands the commands will not work. The commands below have the proper spacing and are suitable for copying and pasting into the Command Prompt.
net stop bits
net stop wuauserv
net stop appidsvc
net stop cryptsvc
net stop msiserver
Shutting down these services allows us to get rid of hung files connected to the services (aka: not in use).
Step 3 – Remove Files for Current Hung/Failed Update
At the prompt (>) enter the following command and press the Enter key. The system will respond with Are you sure? (Y/N) to confirm the deletion, which you enter Y and press the Enter key. The system will not respond and the file is deleted. If the system can’t delete the file it responds with a message as to why such as “The process cannot access the file because it is being used by another process”. This means the service is not stopped (could have turned itself back on) so repeat Step 2 above to stop the service.
Also notice the spaces between the command words in the command below. Without the proper spacing in the command the command will not work. The command below has the proper spacing and is suitable for copying and pasting into the Command Prompt.
Del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\*.*"
This command deletes the data file created by the BITS service during the update process.
At the prompt (>) enter the following commands and press the Enter key after entering each command. The system will not ask for confirmation for removing these files and will not respond if the files are deleted as the command indicated. If the system can’t delete the file it responds with a message as to why such as “The process cannot access the file because it is being used by another process”. This means the service is not stopped (could have turned itself back on) so repeat Step 2 above to stop the service.
Also notice the spaces between the command words in the commands below. Without the proper space in the commands the commands will not work. The commands below have the proper spacing and are suitable for copying and pasting into the Command Prompt.
rmdir %systemroot%\SoftwareDistribution /S /Q
rmdir %systemroot%\system32\catroot2 /S /Q
The above commands will delete all files associated with the hung/failed update. The /S option deletes all files and folders in that folder and the /Q option negates the need to confirm the deletions.
Step 4 – Reset BITS and Windows Update Services Security Descriptors
At the prompt (>) enter the following commands and press the Enter key after entering each command. If enter correctly the system will respond that the SetServiceObjectsSecurity SUCCESS. Make sure you get the SUCCESS response for each service.
It is best to copy and paste each command.
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)
Step 5 – Register all DLL Files Used by BITS and Windows Update Services
At the prompt (>) enter the following command followed by pressing the Enter key. Be sure to include the space between cd and /d and the space between /d and %windir%\system32. The following command is suitable for copy and pasting.
cd /d %windir%\system32
This command will change the directory of the Command Prompt to the Windows System32 folder. If the prompt is already at Windows\System32, no need to run the command to change the directory of the prompt. DLL files are registered with regsvr32.exe which is in the System32 folder. Moving the prompt to the Windows\System32 folder negates the need to enter the full PATH address for regsvr32.exe file in each of the following commands so the prompt must look like this (if Windows is installed on the C:\ drive):
C:\Windows\System32>
for the commands below to register the DLL files.
At the prompt (Windows\System32>) enter each of the following commands to register each DLL file. Press the Enter key after entering the command line. The prompt will return to Windows\System32> ready for the next DLL file to be registered. Register each file one at a time. Be sure to include the space between regsvr.exe and the /s option and the space between the /s option and the DLL file name. The commands below are suitable for copying and pasting into the Command Prompt. If you do get an error message, it most likely will be due to incorrect spelling or spacing in the command entered.
regsvr32.exe /s atl.dll
regsvr32.exe /s urlmon.dll
regsvr32.exe /s mshtml.dll
regsvr32.exe /s shdocvw.dll
regsvr32.exe /s browseui.dll
regsvr32.exe /s jscript.dll
regsvr32.exe /s vbscript.dll
regsvr32.exe /s scrrun.dll
regsvr32.exe /s msxml.dll
regsvr32.exe /s msxml3.dll
regsvr32.exe /s msxml6.dll
regsvr32.exe /s actxprxy.dll
regsvr32.exe /s softpub.dll
regsvr32.exe /s wintrust.dll
regsvr32.exe /s dssenh.dll
regsvr32.exe /s rsaenh.dll
regsvr32.exe /s gpkcsp.dll
regsvr32.exe /s sccbase.dll
regsvr32.exe /s slbcsp.dll
regsvr32.exe /s cryptdlg.dll
regsvr32.exe /s oleaut32.dll
regsvr32.exe /s ole32.dll
regsvr32.exe /s shell32.dll
regsvr32.exe /s initpki.dll
regsvr32.exe /s wuapi.dll
regsvr32.exe /s wuaueng.dll
regsvr32.exe /s wuaueng1.dll
regsvr32.exe /s wucltui.dll
regsvr32.exe /s wups.dll
regsvr32.exe /s wups2.dll
regsvr32.exe /s wuweb.dll
regsvr32.exe /s qmgr.dll
regsvr32.exe /s qmgrprxy.dll
regsvr32.exe /s wucltux.dll
regsvr32.exe /s muweb.dll
regsvr32.exe /s wuwebv.dll
The /s option registers the DLL files without messages or confirmations to help speed up this process.
Step 6 – Reset Your Network Configuration
At the prompt (>) enter the following commands and press the Enter key to run that command. Note the space between the command words in the command line. These commands are suitable for copying and pasting. The system will state that you need to restart the computer to complete the reset, but do not restart until instructed to in the step below.
netsh winsock reset
netsh winsock reset proxy
Step 7 – Restart BITS, Windows Update, and Related Components
Now we restart those services that we stopped in Step 2 above
At the prompt (>) enter each command line below pressing the Enter key after entering that command line to run that command. The system will respond with a message that the service is starting and when started a message that it has been started successfully.
Also notice the spaces between the command words in the commands below. Without the proper spacing in the commands the commands will not work. The commands below have the proper spacing and are suitable for copying and pasting into the Command Prompt
net start bits
net start wuauserv
net start appidsvc
net start cryptsvc
net start msiserver
Once all the services have successfully restarted, restart the computer and the Windows Update should be working again.