Jump to content

Your Help & Skills: Combining/Merging Three (3) .bat Files


pc71520

Recommended Posts

The Reset Windows Update Agent file is described HERE

A Review by thewindowsclub.com can be found HERE

Download


As shown above, the Script is the following:

:: ==================================================================================


:: NAME : Reset Windows Update Components.
:: DESCRIPTION : This script reset the Windows Update Components.
:: AUTHOR : Manuel Gil.
:: VERSION : 9.1.0
:: ==================================================================================


:: CMD Screen Settings.
:: /************************************************************************************/
echo off
title Reset Windows Update Agent.
mode con cols=78 lines=24
color 17
cls
:: /************************************************************************************/


:: Checking for Administrator elevation.
:: /************************************************************************************/
openfiles>nul 2>&1

if %errorlevel%==0 goto Variables

cls
ver
echo.Reset Windows Update Components Tool.
echo.
echo.Checking for Administrator elevation.
echo.
echo. You are not running as Administrator.
echo. This batch cannot do it's job without elevation.
echo.
echo. You must run this tool as Administrator.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
:: /************************************************************************************/


:: Set variables.
:: /************************************************************************************/
:Variables

for /f "tokens=4-5 delims=[] " %%a in ('ver') do set version=%%a %%b

for %%a in (%version%) do set version=%%a

if %version%==5.1.2600 (
set name=Windows XP
set allow=1
) else if %version%==5.2.3790 (
set name=Windows XP Professional x64 Edition
set allow=1
) else if %version%==6.0.6000 (
set name=Windows Vista
set allow=1
) else if %version%==6.0.6001 (
set name=Windows Vista SP1
set allow=1
) else if %version%==6.0.6002 (
set name=Windows Vista SP2
set allow=1
) else if %version%==6.1.7600 (
set name=Windows 7
set allow=1
) else if %version%==6.1.7601 (
set name=Windows 7 SP1
set allow=1
) else if %version%==6.2.9200 (
set name=Windows 8
set allow=1
) else if %version%==6.3.9200 (
set name=Windows 8.1
set allow=1
) else if %version%==6.3.9600 (
set name=Windows 8.1 Update 1
set allow=1
) else if %version%==10.0.10240 (
set name=Windows 10
set allow=1
) else if %version%==10.0.10565 (
set name=Windows 10 Insider
set allow=1
) else if %version%==10.0.10576 (
set name=Windows 10 Insider
set allow=1
) else (
set name=Windows
set allow=0
)

cls
ver
echo.Reset Windows Update Components Tool.
echo.
echo.Microsoft %name% detected . . .
echo.

if %allow%==0 echo.Sorry, this Operative System is not compatible whit this tool.
if %allow%==1 goto Terms

echo.
echo. An error occurred while attempting to verify your system.
echo. Can this using a business or test version.
echo.
echo. If not, verify that your system has the correct security fix.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
:: /************************************************************************************/


:: Terms.
:: /*************************************************************************************/
:Terms

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. The methods inside this batch modify files and registry settings.
echo. While they are tested and tend to work, I take no responsibility for
echo. the use of this file.
echo. This batch is provided without warranty. Any damage caused is your
echo. own responsibility.
echo.
echo. As well, batch files are almost always flagged by anti-virus, feel free
echo. to review the code if you're unsure.
echo.

choice /c YN /n /m "Do you want to continue with this process? (Y/N) "
if %errorlevel%==1 goto Menu
if %errorlevel%==2 goto Close

echo.
echo.An unexpected error has occurred.
echo.
echo.Press any key to continue . . .
pause>nul
goto Menu
:: /*************************************************************************************/


:: Menu of tool.
:: /*************************************************************************************/
:Menu

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. 1. Open the system protection.
echo. 2. Scans all protected system files (Scannow).
echo. 3. Scan the image to check for corruption (ScanHealth).
echo. 4. Check the detected corruptions (CheckHealth).
echo. 5. Repair the image (RestoreHealth).
echo. 6. Clean up the superseded components (StartComponentCleanup).
echo. 7. Reset Windows Update Components.
echo. 8. Delete temporary files in Windows.
echo. 9. Open the Internet Explorer options.
echo. 10. Change invalid values in the Registry.
echo. 11. Reset the Winsock settings.
echo. 12. Search updates.
echo. 13. Explore other local solutions.
echo. 14. Explore other online solutions.
echo. 15. Restart your PC.
echo.
echo. ?. Help. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
call :SystemProperties
) else if "%option%"=="2" (
call :ScanNow
) else if "%option%"=="3" (
call :ScanHealth
) else if "%option%"=="4" (
call :CheckHealth
) else if "%option%"=="5" (
call :RestoreHealth
) else if "%option%"=="6" (
call :StartComponent
) else if "%option%"=="7" (
call :Reset
) else if "%option%"=="8" (
call :Temp
) else if "%option%"=="9" (
call :IExplore
) else if "%option%"=="10" (
call :Regedit
) else if "%option%"=="11" (
call :Winsock
) else if "%option%"=="12" (
call :Search
) else if "%option%"=="13" (
call :Local
) else if "%option%"=="14" (
call :Online
) else if "%option%"=="15" (
call :Restart
) else if "%option%"=="?" (
call :Help_1
) else if "%option%"=="0" (
goto Close
)

goto Menu
:: /*************************************************************************************/


:: Print Top Text.
:: /*************************************************************************************/
:Print

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo.%*
echo.

goto :Eof
:: /*************************************************************************************/


:: Add Value in the Registry.
:: /*************************************************************************************/
:AddReg

reg add "%~1" /v "%~2" /t "%~3" /d "%~4" /f

goto :Eof
:: /*************************************************************************************/


:: Change invalid values.
:: /*************************************************************************************/
:Regedit

for /f "tokens=1-5 delims=/, " %%a in ("%date%") do (
set now=%%a%%b%%c%%d%time:~0,2%%time:~3,2%
)

:: ----- Create a backup of the Registry -----
call :Print Making a backup copy of the Registry in: %USERPROFILE%\Desktop\Backup%now%.reg

if exist "%USERPROFILE%\Desktop\Backup%now%.reg" (
echo.An unexpected error has occurred.
echo.
echo. Changes were not carried out in the registry.
echo. Will try it later.
echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
) else (
regedit /e "%USERPROFILE%\Desktop\Backup%now%.reg"
)

:: ----- Checking backup -----
call :Print Checking the backup copy.

if not exist "%USERPROFILE%\Desktop\Backup%now%.reg" (
echo.An unexpected error has occurred.
echo.
echo. Something went wrong.
echo. You manually create a backup of the registry before continuing.
echo.
echo.Press any key to continue . . .
pause>nul
) else (
echo.The operation completed successfully.
echo.
)

:: ----- Delete keys in the Registry -----
call :Print Deleting values in the Registry.

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f
reg delete "HKLM\COMPONENTS\PendingXmlIdentifier" /f
reg delete "HKLM\COMPONENTS\NextQueueEntryIndex" /f
reg delete "HKLM\COMPONENTS\AdvancedInstallersNeedResolving" /f

:: ----- Add keys in the Registry -----
call :Print Adding values in the Registry.

set key=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
call :AddReg "%key%" "AppData" "REG_EXPAND_SZ" "%USERPROFILE%\AppData\Roaming"

set key=HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
call :AddReg "%key%" "AppData" "REG_EXPAND_SZ" "%USERPROFILE%\AppData\Roaming"

set key=HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
call :AddReg "%key%" "AppData" "REG_EXPAND_SZ" "%USERPROFILE%\AppData\Roaming"

set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate
call :AddReg "%key%" "AllowOSUpgrade" "REG_DWORD" "1"

reg add "HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup" /f

set key=HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains
call :AddReg "%key%\microsoft.com\update" "http" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\update" "https" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\windowsupdate" "http" "REG_DWORD" "2"
call :AddReg "%key%\update.microsoft.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\update.microsoft.com" "https" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.microsoft.com" "http" "REG_DWORD" "2
call :AddReg "%key%\download.microsoft.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com" "https" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com\download" "http" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com\download" "https" "REG_DWORD" "2"
call :AddReg "%key%\download.windowsupdate.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\download.windowsupdate.com" "https" "REG_DWORD" "2"
call :AddReg "%key%\windows.com\wustat" "http" "REG_DWORD" "2"
call :AddReg "%key%\wustat.windows.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\ntservicepack" "http" "REG_DWORD" "2"
call :AddReg "%key%\ntservicepack.microsoft.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\ws" "http" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\ws" "https" "REG_DWORD" "2"
call :AddReg "%key%\ws.microsoft.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\ws.microsoft.com" "https" "REG_DWORD" "2"

:: ----- End process -----
call :Print The operation completed successfully.

echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Run the reset Windows Update components.
:: /*************************************************************************************/
:Reset

:: ----- Stopping the Windows Update services -----
call :Print Stopping the Windows Update services.
net stop bits

call :Print Stopping the Windows Update services.
net stop wuauserv

call :Print Stopping the Windows Update services.
net stop appidsvc

call :Print Stopping the Windows Update services.
net stop cryptsvc

:: ----- Checking the services status -----
call :Print Checking the services status.

sc query bits | findstr /I /C:"STOPPED"
If not %errorlevel%==0 (
echo.Failed to stop the BITS service.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
)

call :Print Checking the services status.

sc query wuauserv | findstr /I /C:"STOPPED"
if not %errorlevel%==0 (
echo.Failed to stop the Windows Update service.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
)

call :Print Checking the services status.

sc query appidsvc | findstr /I /C:"STOPPED"
if not %errorlevel%==0 (
sc query appidsvc | findstr /I /C:"OpenService FAILED 1060"
if not %errorlevel%==0 (
echo.Failed to stop the Application Identity service.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
)
)

call :Print Checking the services status.

sc query cryptsvc | findstr /I /C:"STOPPED"
If not %errorlevel%==0 (
echo.Failed to stop the Cryptographic Services service.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
)

:: ----- Delete the qmgr*.dat files -----
call :Print Deleting the qmgr*.dat files.

del /s /q /f "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat"

:: ----- Renaming the softare distribution folders backup copies -----
call :Print Renaming the softare distribution folders backup copies.

cd /d %SYSTEMROOT%

if exist "%SYSTEMROOT%\winsxs\pending.xml.bak" del /s /q /f "%SYSTEMROOT%\winsxs\pending.xml.bak"
if exist "%SYSTEMROOT%\SoftwareDistribution.bak" rmdir /s /q "%SYSTEMROOT%\SoftwareDistribution.bak"
if exist "%SYSTEMROOT%\system32\Catroot2.bak" rmdir /s /q "%SYSTEMROOT%\system32\Catroot2.bak"
if exist "%SYSTEMROOT%\WindowsUpdate.log.bak" del /s /q /f "%SYSTEMROOT%\WindowsUpdate.log.bak"

if exist "%SYSTEMROOT%\winsxs\pending.xml" (
takeown /f "%SYSTEMROOT%\winsxs\pending.xml"
attrib -r -s -h /s /d "%SYSTEMROOT%\winsxs\pending.xml"
ren "%SYSTEMROOT%\winsxs\pending.xml" pending.xml.bak
)

if exist "%SYSTEMROOT%\SoftwareDistribution" (
attrib -r -s -h /s /d "%SYSTEMROOT%\SoftwareDistribution"
ren "%SYSTEMROOT%\SoftwareDistribution" SoftwareDistribution.bak
)

if exist "%SYSTEMROOT%\system32\Catroot2" (
attrib -r -s -h /s /d "%SYSTEMROOT%\system32\Catroot2"
ren "%SYSTEMROOT%\system32\Catroot2" Catroot2.bak
)

if exist "%SYSTEMROOT%\WindowsUpdate.log" (
attrib -r -s -h /s /d "%SYSTEMROOT%\WindowsUpdate.log"
ren "%SYSTEMROOT%\WindowsUpdate.log" WindowsUpdate.log.bak
)

:: ----- Reset the BITS service and the Windows Update service to the default security descriptor -----
call :Print Reset the BITS service and the Windows Update service to the default security descriptor.

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)

:: ----- Reregister the BITS files and the Windows Update files -----
call :Print Reregister the BITS files and the Windows Update files.

cd /d %WINDIR%\system32
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

:: ----- Resetting Winsock -----
call :Print Resetting Winsock.

netsh winsock reset

:: ----- Resetting WinHTTP Proxy -----
call :Print Resetting WinHTTP Proxy.

netsh winhttp reset proxy

:: ----- Starting the Windows Update services -----
call :Print Starting the Windows Update services.

net start bits

call :Print Starting the Windows Update services.

net start wuauserv

call :Print Starting the Windows Update services.

net start appidsvc

call :Print Starting the Windows Update services.

net start cryptsvc

:: ----- End process -----
call :Print The operation completed successfully.

echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Delete temporary files in Windows.
:: /*************************************************************************************/
:Temp

call :Print Deleting temporary files in Windows.

cd /d %TEMP%
del /s /f /q *.*

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/



:: Scans all protected system files.
:: /*************************************************************************************/
:ScanNow

call :Print Scans all protected system files.

sfc /scannow

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Scan the image to check for corruption.
:: /*************************************************************************************/
:ScanHealth

call :Print Scanning the image to check for corruption.

Dism.exe /Online /Cleanup-Image /ScanHealth

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Check the detected corruptions.
:: /*************************************************************************************/
:CheckHealth

call :Print Checking the detected corruptions.

Dism.exe /Online /Cleanup-Image /CheckHealth

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Repair the image.
:: /*************************************************************************************/
:RestoreHealth

call :Print Repairing the image.

Dism.exe /Online /Cleanup-Image /RestoreHealth

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Clean up the superseded components .
:: /*************************************************************************************/
:StartComponent

call :Print Clean up the superseded components.

Dism.exe /Online /Cleanup-Image /StartComponentCleanup

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Open system protection.
:: /*************************************************************************************/
:SystemProperties

call :Print Opening the system protection.

start systempropertiesprotection

goto :Eof
:: /*************************************************************************************/


:: Open the Internet Explorer options.
:: /*************************************************************************************/
:IExplore

call :Print Opening the Internet Explorer options.

start InetCpl.cpl

goto :Eof
:: /*************************************************************************************/


:: Reset Winsock setting.
:: /*************************************************************************************/
:Winsock

:: ----- Reset Winsock control -----
call :Print Reset Winsock control.

net localgroup Administradores localservice /add
pause>nul
fsutil resource setautoreset true C:\
pause>nul
netsh int ip reset
pause>nul
netsh winsock reset
pause>nul
netsh advfirewall reset
pause>nul
ipconfig /flushdns
pause>nul
netsh winhttp reset proxy
pause>nul

:: ----- End process -----
call :Print The operation completed successfully.

echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Search Updates.
:: /*************************************************************************************/
:Search

call :Print Looking for updates.

echo.Take a few minutes.
echo.
echo.Press any key to continue . . .
pause>nul

if %version%==10.0.10240 (
start ms-settings:windowsupdate
) else if %version%==10.0.10565 (
start ms-settings:windowsupdate
) else if %version%==10.0.10576 (
start ms-settings:windowsupdate
) else (
start wuapp.exe
)

call :Print Looking for updates.

echo.Wait . . .
echo.
wuauclt /resetauthorization /detectnow

goto :Eof
:: /*************************************************************************************/


:: Explore other local solutions.
:: /*************************************************************************************/
:Local

call :Print Looking for solutions in this PC.

start control.exe /name Microsoft.Troubleshooting

goto :Eof
:: /*************************************************************************************/


:: Explore other online solutions.
:: /*************************************************************************************/
:Online

call :Print Looking for solutions Online.

start https://support.microsoft.com/en-us/gp/windows-update-issues/

goto :Eof
:: /*************************************************************************************/


:: Reboot the system.
:: /*************************************************************************************/
:Restart

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. The system reboot in 60 seconds.
echo. Please save all open documents.
echo.

start shutdown.exe /r /t 60 /c "The system reboot in 60 seconds. Please save all open documents."

echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Help Menu.
:: /*************************************************************************************/
:Help_1

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. Name:
echo. Reset Windows Update Components.
echo.
echo. Description:
echo. This script reset the Windows Update Components.
echo.
echo. Purpose:
echo. This tools has been developed for use as a support system repair
echo. options.
echo.
echo. Usage:
echo. First, it's advisable to disable the antivirus temporarily, as this may
echo. interfere corrections made by the tool.
echo.
echo. Verify that the time and date of your system are up to date.
echo.
echo. 1. Back. 2. Next. 3. Menu. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
goto :Eof
) else if "%option%"=="2" (
goto Help_2
) else if "%option%"=="3" (
goto :Eof
) else if "%option%"=="0" (
goto Close
)

goto Help_1
:: /*************************************************************************************/


:: Help Menu.
:: /*************************************************************************************/
:Help_2

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. Create a restore point into the system properties protection.
echo.
echo. It's advisable to repair the system before reset the Windows Update
echo. Components.
echo.
echo. For repairing the system follow these options (available in
echo. Windows 8, Windows 8.1 and Windows 10):
echo.
echo. Each step will take several minutes.
echo.
echo. a. Scans all protected system files (Scannow).
echo. b. Scan the image to check for corruption (ScanHealth).
echo. c. Check the detected corruptions (CheckHealth).
echo. d. Repair the image (RestoreHealth).
echo. e. Clean up the superseded components (StartComponentCleanup).
echo.
echo. 1. Back. 2. Next. 3. Menu. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
goto Help_1
) else if "%option%"=="2" (
goto Help_3
) else if "%option%"=="3" (
goto :Eof
) else if "%option%"=="0" (
goto Close
)

goto Help_2
:: /*************************************************************************************/


:: Help Menu.
:: /*************************************************************************************/
:Help_3

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. It's advisable to restart your computer after each step.
echo.
echo. For reset the Windows Update Components follow these options:
echo.
echo. a. Reset Windows Update Components.
echo. b. Delete temporary files in Windows.
echo. c. Reset Internet Explorer options.
echo. d. Restart your PC.
echo.
echo. For fix connection issues follow these options:
echo.
echo. a. Change invalid values in the Registry.
echo. b. Reset the Winsock settings.
echo.
echo. It's advisable to restart your computer after each step.
echo.
echo. 1. Back. 2. Next. 3. Menu. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
goto Help_2
) else if "%option%"=="2" (
goto Help_4
) else if "%option%"=="3" (
goto :Eof
) else if "%option%"=="0" (
goto Close
)

goto Help_3
:: /*************************************************************************************/


:: Help Menu.
:: /*************************************************************************************/
:Help_4

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. For fix others issues follow these options.
echo.
echo. a. Change invalid values in the Registry.
echo. b. Restart your PC.
echo.
echo. Author:
echo. Manuel Gil.
echo.
echo. Version:
echo. 9.1.0
echo.
echo. Note:
echo. Translated from the original version in spanish.
echo.
echo.
echo.
echo. 1. Back. 2. Next. 3. Menu. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
goto Help_3
) else if "%option%"=="2" (
goto :Eof
) else if "%option%"=="3" (
goto :Eof
) else if "%option%"=="0" (
goto Close
)

goto Help_4
:: /*************************************************************************************/


:: End tool.
:: /*************************************************************************************/
:Close

exit
:: /*************************************************************************************/

The above Script offers Fifteen (15) Options.

PLEASE, can someone Add the following Two (2) Options

to the above Fifteen (15) ones

so that the Merged .bat file offers Seventeen (17) Options?

Reset Reliability Monitor

reg add "HKLM\SOFTWARE\Microsoft\Reliability Analysis\WMI" /v WMIEnable /T REG_DWORD /D 1 /F


del /f /S /Q /A "%ProgramData%\Microsoft\RAC\PublishedData\*"
del /f /S /Q /A "%ProgramData%\Microsoft\RAC\StateData\*"
@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto noAdmin
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
echo.
echo goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
exit

Notification Area Cleaner

@echo off


taskkill /im explorer.exe /f
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams /f
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream /f
start "Shell Restarter" /d "%systemroot%" /i /normal explorer.exe
shutdown -r -t 0

I hope distinguished Members offer their skills

as the respective File is valuable for System Maintenance.

Link to comment
Share on other sites


  • Replies 11
  • Views 1.7k
  • Created
  • Last Reply
knowledge-Spammer

just looking at the Script its longer then i was thinking

may need help with this i hope some good people will help

Link to comment
Share on other sites


just looking at the Script its longer then i was thinking

may need help with this i hope some good people will help

The issue is how to add two (2) more options

to the fifteen (15) ones that already exist.

Link to comment
Share on other sites


Here you go I didn't test it out but it should work correctly.
Added options 16 (Reset Reliability Monitor) & 17​ (Notification Area Cleaner).

It's easy to do look carefully how I added the stuff without changing the format. It's literally copy and paste...

:: ==================================================================================


:: NAME : Reset Windows Update Components.
:: DESCRIPTION : This script reset the Windows Update Components.
:: AUTHOR : Manuel Gil.
:: VERSION : 9.1.0
:: ==================================================================================


:: CMD Screen Settings.
:: /************************************************************************************/
echo off
title Reset Windows Update Agent.
mode con cols=78 lines=24
color 17
cls
:: /************************************************************************************/


:: Checking for Administrator elevation.
:: /************************************************************************************/
openfiles>nul 2>&1

if %errorlevel%==0 goto Variables

cls
ver
echo.Reset Windows Update Components Tool.
echo.
echo.Checking for Administrator elevation.
echo.
echo. You are not running as Administrator.
echo. This batch cannot do it's job without elevation.
echo.
echo. You must run this tool as Administrator.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
:: /************************************************************************************/


:: Set variables.
:: /************************************************************************************/
:Variables

for /f "tokens=4-5 delims=[] " %%a in ('ver') do set version=%%a %%b

for %%a in (%version%) do set version=%%a

if %version%==5.1.2600 (
set name=Windows XP
set allow=1
) else if %version%==5.2.3790 (
set name=Windows XP Professional x64 Edition
set allow=1
) else if %version%==6.0.6000 (
set name=Windows Vista
set allow=1
) else if %version%==6.0.6001 (
set name=Windows Vista SP1
set allow=1
) else if %version%==6.0.6002 (
set name=Windows Vista SP2
set allow=1
) else if %version%==6.1.7600 (
set name=Windows 7
set allow=1
) else if %version%==6.1.7601 (
set name=Windows 7 SP1
set allow=1
) else if %version%==6.2.9200 (
set name=Windows 8
set allow=1
) else if %version%==6.3.9200 (
set name=Windows 8.1
set allow=1
) else if %version%==6.3.9600 (
set name=Windows 8.1 Update 1
set allow=1
) else if %version%==10.0.10240 (
set name=Windows 10
set allow=1
) else if %version%==10.0.10565 (
set name=Windows 10 Insider
set allow=1
) else if %version%==10.0.10576 (
set name=Windows 10 Insider
set allow=1
) else (
set name=Windows
set allow=0
)

cls
ver
echo.Reset Windows Update Components Tool.
echo.
echo.Microsoft %name% detected . . .
echo.

if %allow%==0 echo.Sorry, this Operative System is not compatible whit this tool.
if %allow%==1 goto Terms

echo.
echo. An error occurred while attempting to verify your system.
echo. Can this using a business or test version.
echo.
echo. If not, verify that your system has the correct security fix.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
:: /************************************************************************************/


:: Terms.
:: /*************************************************************************************/
:Terms

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. The methods inside this batch modify files and registry settings.
echo. While they are tested and tend to work, I take no responsibility for
echo. the use of this file.
echo. This batch is provided without warranty. Any damage caused is your
echo. own responsibility.
echo.
echo. As well, batch files are almost always flagged by anti-virus, feel free
echo. to review the code if you're unsure.
echo.

choice /c YN /n /m "Do you want to continue with this process? (Y/N) "
if %errorlevel%==1 goto Menu
if %errorlevel%==2 goto Close

echo.
echo.An unexpected error has occurred.
echo.
echo.Press any key to continue . . .
pause>nul
goto Menu
:: /*************************************************************************************/


:: Menu of tool.
:: /*************************************************************************************/
:Menu

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. 1. Open the system protection.
echo. 2. Scans all protected system files (Scannow).
echo. 3. Scan the image to check for corruption (ScanHealth).
echo. 4. Check the detected corruptions (CheckHealth).
echo. 5. Repair the image (RestoreHealth).
echo. 6. Clean up the superseded components (StartComponentCleanup).
echo. 7. Reset Windows Update Components.
echo. 8. Delete temporary files in Windows.
echo. 9. Open the Internet Explorer options.
echo. 10. Change invalid values in the Registry.
echo. 11. Reset the Winsock settings.
echo. 12. Search updates.
echo. 13. Explore other local solutions.
echo. 14. Explore other online solutions.
echo. 15. Restart your PC.
echo. 16. Reset Reliability Monitor
echo. 17. Notification Area Cleaner
echo.
echo. ?. Help. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
call :SystemProperties
) else if "%option%"=="2" (
call :ScanNow
) else if "%option%"=="3" (
call :ScanHealth
) else if "%option%"=="4" (
call :CheckHealth
) else if "%option%"=="5" (
call :RestoreHealth
) else if "%option%"=="6" (
call :StartComponent
) else if "%option%"=="7" (
call :Reset
) else if "%option%"=="8" (
call :Temp
) else if "%option%"=="9" (
call :IExplore
) else if "%option%"=="10" (
call :Regedit
) else if "%option%"=="11" (
call :Winsock
) else if "%option%"=="12" (
call :Search
) else if "%option%"=="13" (
call :Local
) else if "%option%"=="14" (
call :Online
) else if "%option%"=="15" (
call :Restart
) else if "%option%"=="16" (
call :rrm
) else if "%option%"=="17" (
call :nac
) else if "%option%"=="?" (
call :Help_1
) else if "%option%"=="0" (
goto Close
)

goto Menu
:: /*************************************************************************************/


:: Print Top Text.
:: /*************************************************************************************/
:Print

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo.%*
echo.

goto :Eof
:: /*************************************************************************************/


:: Add Value in the Registry.
:: /*************************************************************************************/
:AddReg

reg add "%~1" /v "%~2" /t "%~3" /d "%~4" /f

goto :Eof
:: /*************************************************************************************/


:: Change invalid values.
:: /*************************************************************************************/
:Regedit

for /f "tokens=1-5 delims=/, " %%a in ("%date%") do (
set now=%%a%%b%%c%%d%time:~0,2%%time:~3,2%
)

:: ----- Create a backup of the Registry -----
call :Print Making a backup copy of the Registry in: %USERPROFILE%\Desktop\Backup%now%.reg

if exist "%USERPROFILE%\Desktop\Backup%now%.reg" (
echo.An unexpected error has occurred.
echo.
echo. Changes were not carried out in the registry.
echo. Will try it later.
echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
) else (
regedit /e "%USERPROFILE%\Desktop\Backup%now%.reg"
)

:: ----- Checking backup -----
call :Print Checking the backup copy.

if not exist "%USERPROFILE%\Desktop\Backup%now%.reg" (
echo.An unexpected error has occurred.
echo.
echo. Something went wrong.
echo. You manually create a backup of the registry before continuing.
echo.
echo.Press any key to continue . . .
pause>nul
) else (
echo.The operation completed successfully.
echo.
)

:: ----- Delete keys in the Registry -----
call :Print Deleting values in the Registry.

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f
reg delete "HKLM\COMPONENTS\PendingXmlIdentifier" /f
reg delete "HKLM\COMPONENTS\NextQueueEntryIndex" /f
reg delete "HKLM\COMPONENTS\AdvancedInstallersNeedResolving" /f

:: ----- Add keys in the Registry -----
call :Print Adding values in the Registry.

set key=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
call :AddReg "%key%" "AppData" "REG_EXPAND_SZ" "%USERPROFILE%\AppData\Roaming"

set key=HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
call :AddReg "%key%" "AppData" "REG_EXPAND_SZ" "%USERPROFILE%\AppData\Roaming"

set key=HKU\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
call :AddReg "%key%" "AppData" "REG_EXPAND_SZ" "%USERPROFILE%\AppData\Roaming"

set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate
call :AddReg "%key%" "AllowOSUpgrade" "REG_DWORD" "1"

reg add "HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup" /f

set key=HKLM\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains
call :AddReg "%key%\microsoft.com\update" "http" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\update" "https" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\windowsupdate" "http" "REG_DWORD" "2"
call :AddReg "%key%\update.microsoft.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\update.microsoft.com" "https" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.microsoft.com" "http" "REG_DWORD" "2
call :AddReg "%key%\download.microsoft.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com" "https" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com\download" "http" "REG_DWORD" "2"
call :AddReg "%key%\windowsupdate.com\download" "https" "REG_DWORD" "2"
call :AddReg "%key%\download.windowsupdate.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\download.windowsupdate.com" "https" "REG_DWORD" "2"
call :AddReg "%key%\windows.com\wustat" "http" "REG_DWORD" "2"
call :AddReg "%key%\wustat.windows.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\ntservicepack" "http" "REG_DWORD" "2"
call :AddReg "%key%\ntservicepack.microsoft.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\ws" "http" "REG_DWORD" "2"
call :AddReg "%key%\microsoft.com\ws" "https" "REG_DWORD" "2"
call :AddReg "%key%\ws.microsoft.com" "http" "REG_DWORD" "2"
call :AddReg "%key%\ws.microsoft.com" "https" "REG_DWORD" "2"

:: ----- End process -----
call :Print The operation completed successfully.

echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Run the reset Windows Update components.
:: /*************************************************************************************/
:Reset

:: ----- Stopping the Windows Update services -----
call :Print Stopping the Windows Update services.
net stop bits

call :Print Stopping the Windows Update services.
net stop wuauserv

call :Print Stopping the Windows Update services.
net stop appidsvc

call :Print Stopping the Windows Update services.
net stop cryptsvc

:: ----- Checking the services status -----
call :Print Checking the services status.

sc query bits | findstr /I /C:"STOPPED"
If not %errorlevel%==0 (
echo.Failed to stop the BITS service.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
)

call :Print Checking the services status.

sc query wuauserv | findstr /I /C:"STOPPED"
if not %errorlevel%==0 (
echo.Failed to stop the Windows Update service.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
)

call :Print Checking the services status.

sc query appidsvc | findstr /I /C:"STOPPED"
if not %errorlevel%==0 (
sc query appidsvc | findstr /I /C:"OpenService FAILED 1060"
if not %errorlevel%==0 (
echo.Failed to stop the Application Identity service.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
)
)

call :Print Checking the services status.

sc query cryptsvc | findstr /I /C:"STOPPED"
If not %errorlevel%==0 (
echo.Failed to stop the Cryptographic Services service.
echo.
echo.Press any key to continue . . .
pause>nul
goto Close
)

:: ----- Delete the qmgr*.dat files -----
call :Print Deleting the qmgr*.dat files.

del /s /q /f "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat"

:: ----- Renaming the softare distribution folders backup copies -----
call :Print Renaming the softare distribution folders backup copies.

cd /d %SYSTEMROOT%

if exist "%SYSTEMROOT%\winsxs\pending.xml.bak" del /s /q /f "%SYSTEMROOT%\winsxs\pending.xml.bak"
if exist "%SYSTEMROOT%\SoftwareDistribution.bak" rmdir /s /q "%SYSTEMROOT%\SoftwareDistribution.bak"
if exist "%SYSTEMROOT%\system32\Catroot2.bak" rmdir /s /q "%SYSTEMROOT%\system32\Catroot2.bak"
if exist "%SYSTEMROOT%\WindowsUpdate.log.bak" del /s /q /f "%SYSTEMROOT%\WindowsUpdate.log.bak"

if exist "%SYSTEMROOT%\winsxs\pending.xml" (
takeown /f "%SYSTEMROOT%\winsxs\pending.xml"
attrib -r -s -h /s /d "%SYSTEMROOT%\winsxs\pending.xml"
ren "%SYSTEMROOT%\winsxs\pending.xml" pending.xml.bak
)

if exist "%SYSTEMROOT%\SoftwareDistribution" (
attrib -r -s -h /s /d "%SYSTEMROOT%\SoftwareDistribution"
ren "%SYSTEMROOT%\SoftwareDistribution" SoftwareDistribution.bak
)

if exist "%SYSTEMROOT%\system32\Catroot2" (
attrib -r -s -h /s /d "%SYSTEMROOT%\system32\Catroot2"
ren "%SYSTEMROOT%\system32\Catroot2" Catroot2.bak
)

if exist "%SYSTEMROOT%\WindowsUpdate.log" (
attrib -r -s -h /s /d "%SYSTEMROOT%\WindowsUpdate.log"
ren "%SYSTEMROOT%\WindowsUpdate.log" WindowsUpdate.log.bak
)

:: ----- Reset the BITS service and the Windows Update service to the default security descriptor -----
call :Print Reset the BITS service and the Windows Update service to the default security descriptor.

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)

:: ----- Reregister the BITS files and the Windows Update files -----
call :Print Reregister the BITS files and the Windows Update files.

cd /d %WINDIR%\system32
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

:: ----- Resetting Winsock -----
call :Print Resetting Winsock.

netsh winsock reset

:: ----- Resetting WinHTTP Proxy -----
call :Print Resetting WinHTTP Proxy.

netsh winhttp reset proxy

:: ----- Starting the Windows Update services -----
call :Print Starting the Windows Update services.

net start bits

call :Print Starting the Windows Update services.

net start wuauserv

call :Print Starting the Windows Update services.

net start appidsvc

call :Print Starting the Windows Update services.

net start cryptsvc

:: ----- End process -----
call :Print The operation completed successfully.

echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/

:rrm
reg add "HKLM\SOFTWARE\Microsoft\Reliability Analysis\WMI" /v WMIEnable /T REG_DWORD /D 1 /F
del /f /S /Q /A "%ProgramData%\Microsoft\RAC\PublishedData\*"
del /f /S /Q /A "%ProgramData%\Microsoft\RAC\StateData\*"
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto noAdmin
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
echo.
exit
:do_clear
echo clearing %1
wevtutil.exe cl %1
exit

:nac
taskkill /im explorer.exe /f
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams /f
reg delete "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream /f
start "Shell Restarter" /d "%systemroot%" /i /normal explorer.exe
shutdown -r -t 0
exit

:: Delete temporary files in Windows.
:: /*************************************************************************************/
:Temp

call :Print Deleting temporary files in Windows.

cd /d %TEMP%
del /s /f /q *.*

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/



:: Scans all protected system files.
:: /*************************************************************************************/
:ScanNow

call :Print Scans all protected system files.

sfc /scannow

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Scan the image to check for corruption.
:: /*************************************************************************************/
:ScanHealth

call :Print Scanning the image to check for corruption.

Dism.exe /Online /Cleanup-Image /ScanHealth

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Check the detected corruptions.
:: /*************************************************************************************/
:CheckHealth

call :Print Checking the detected corruptions.

Dism.exe /Online /Cleanup-Image /CheckHealth

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Repair the image.
:: /*************************************************************************************/
:RestoreHealth

call :Print Repairing the image.

Dism.exe /Online /Cleanup-Image /RestoreHealth

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Clean up the superseded components .
:: /*************************************************************************************/
:StartComponent

call :Print Clean up the superseded components.

Dism.exe /Online /Cleanup-Image /StartComponentCleanup

echo.
echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Open system protection.
:: /*************************************************************************************/
:SystemProperties

call :Print Opening the system protection.

start systempropertiesprotection

goto :Eof
:: /*************************************************************************************/


:: Open the Internet Explorer options.
:: /*************************************************************************************/
:IExplore

call :Print Opening the Internet Explorer options.

start InetCpl.cpl

goto :Eof
:: /*************************************************************************************/


:: Reset Winsock setting.
:: /*************************************************************************************/
:Winsock

:: ----- Reset Winsock control -----
call :Print Reset Winsock control.

net localgroup Administradores localservice /add
pause>nul
fsutil resource setautoreset true C:\
pause>nul
netsh int ip reset
pause>nul
netsh winsock reset
pause>nul
netsh advfirewall reset
pause>nul
ipconfig /flushdns
pause>nul
netsh winhttp reset proxy
pause>nul

:: ----- End process -----
call :Print The operation completed successfully.

echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Search Updates.
:: /*************************************************************************************/
:Search

call :Print Looking for updates.

echo.Take a few minutes.
echo.
echo.Press any key to continue . . .
pause>nul

if %version%==10.0.10240 (
start ms-settings:windowsupdate
) else if %version%==10.0.10565 (
start ms-settings:windowsupdate
) else if %version%==10.0.10576 (
start ms-settings:windowsupdate
) else (
start wuapp.exe
)

call :Print Looking for updates.

echo.Wait . . .
echo.
wuauclt /resetauthorization /detectnow

goto :Eof
:: /*************************************************************************************/


:: Explore other local solutions.
:: /*************************************************************************************/
:Local

call :Print Looking for solutions in this PC.

start control.exe /name Microsoft.Troubleshooting

goto :Eof
:: /*************************************************************************************/


:: Explore other online solutions.
:: /*************************************************************************************/
:Online

call :Print Looking for solutions Online.

start https://support.micr...-update-issues/

goto :Eof
:: /*************************************************************************************/


:: Reboot the system.
:: /*************************************************************************************/
:Restart

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. The system reboot in 60 seconds.
echo. Please save all open documents.
echo.

start shutdown.exe /r /t 60 /c "The system reboot in 60 seconds. Please save all open documents."

echo.Press any key to continue . . .
pause>nul
goto :Eof
:: /*************************************************************************************/


:: Help Menu.
:: /*************************************************************************************/
:Help_1

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. Name:
echo. Reset Windows Update Components.
echo.
echo. Description:
echo. This script reset the Windows Update Components.
echo.
echo. Purpose:
echo. This tools has been developed for use as a support system repair
echo. options.
echo.
echo. Usage:
echo. First, it's advisable to disable the antivirus temporarily, as this may
echo. interfere corrections made by the tool.
echo.
echo. Verify that the time and date of your system are up to date.
echo.
echo. 1. Back. 2. Next. 3. Menu. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
goto :Eof
) else if "%option%"=="2" (
goto Help_2
) else if "%option%"=="3" (
goto :Eof
) else if "%option%"=="0" (
goto Close
)

goto Help_1
:: /*************************************************************************************/


:: Help Menu.
:: /*************************************************************************************/
:Help_2

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. Create a restore point into the system properties protection.
echo.
echo. It's advisable to repair the system before reset the Windows Update
echo. Components.
echo.
echo. For repairing the system follow these options (available in
echo. Windows 8, Windows 8.1 and Windows 10):
echo.
echo. Each step will take several minutes.
echo.
echo. a. Scans all protected system files (Scannow).
echo. b. Scan the image to check for corruption (ScanHealth).
echo. c. Check the detected corruptions (CheckHealth).
echo. d. Repair the image (RestoreHealth).
echo. e. Clean up the superseded components (StartComponentCleanup).
echo.
echo. 1. Back. 2. Next. 3. Menu. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
goto Help_1
) else if "%option%"=="2" (
goto Help_3
) else if "%option%"=="3" (
goto :Eof
) else if "%option%"=="0" (
goto Close
)

goto Help_2
:: /*************************************************************************************/


:: Help Menu.
:: /*************************************************************************************/
:Help_3

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. It's advisable to restart your computer after each step.
echo.
echo. For reset the Windows Update Components follow these options:
echo.
echo. a. Reset Windows Update Components.
echo. b. Delete temporary files in Windows.
echo. c. Reset Internet Explorer options.
echo. d. Restart your PC.
echo.
echo. For fix connection issues follow these options:
echo.
echo. a. Change invalid values in the Registry.
echo. b. Reset the Winsock settings.
echo.
echo. It's advisable to restart your computer after each step.
echo.
echo. 1. Back. 2. Next. 3. Menu. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
goto Help_2
) else if "%option%"=="2" (
goto Help_4
) else if "%option%"=="3" (
goto :Eof
) else if "%option%"=="0" (
goto Close
)

goto Help_3
:: /*************************************************************************************/


:: Help Menu.
:: /*************************************************************************************/
:Help_4

cls
echo.
echo.Microsoft %name% [Version: %version%]
echo.Reset Windows Update Components Tool.
echo.
echo. For fix others issues follow these options.
echo.
echo. a. Change invalid values in the Registry.
echo. b. Restart your PC.
echo.
echo. Author:
echo. Manuel Gil.
echo.
echo. Version:
echo. 9.1.0
echo.
echo. Note:
echo. Translated from the original version in spanish.
echo.
echo.
echo.
echo. 1. Back. 2. Next. 3. Menu. 0. Close.
echo.

set /p option= Select an option:
if "%option%"=="1" (
goto Help_3
) else if "%option%"=="2" (
goto :Eof
) else if "%option%"=="3" (
goto :Eof
) else if "%option%"=="0" (
goto Close
)

goto Help_4
:: /*************************************************************************************/


:: End tool.
:: /*************************************************************************************/
:Close

exit
:: /*************************************************************************************/

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...