14 Commits

Author SHA1 Message Date
ManuelGil
3a9e4b99c8 Update version 10.5.3.7 2019-06-03 22:26:02 -05:00
ManuelGil
2c88f81580 Update Regedit Backup 2019-04-25 22:49:48 -05:00
ManuelGil
87ff52faf5 Delete aka.ms/startmenuTS 2019-04-18 17:28:37 -05:00
ManuelGil
e54838386c Update README.md 2019-02-15 22:32:02 -05:00
ManuelGil
81151e440d Update to version 10.5.3.6 2018-06-07 21:54:39 -05:00
Manuel Gil
a905c2e5d3 Update README.md 2018-03-28 09:10:14 -05:00
Manuel Gil
a8122e0e6f Update README.md 2018-03-28 09:03:16 -05:00
Manuel Gil
76dc98c832 docs update 2018-03-26 18:18:14 -05:00
Manuel Gil
8755b57387 Update README.md 2017-12-23 09:25:34 -05:00
Manuel Gil
8f6a35cb41 Update README.md 2017-12-22 20:47:53 -05:00
Manuel Gil
fd3d6648ea Update to version 10.5.3.5 2017-12-22 20:42:11 -05:00
Manuel Gil
7bedd614bc Readme Update 2017-12-03 10:08:58 -05:00
Manuel Gil
fc9dbdb6c2 Update to version 10.5.3.4 2017-11-30 08:29:56 -05:00
Manuel Gil
218af1b70f Create README.md 2017-07-01 13:42:55 -05:00
2 changed files with 516 additions and 112 deletions

283
README.md Normal file
View File

@@ -0,0 +1,283 @@
<div align="center">
<h1> Reset Windows Update Tool (Script) </h1>
</div>
<div align="center">
<a href="https://wureset.com/downloads.php" target="_blank">
<img src="https://github.com/ManuelGil/Reset-Windows-Update-Tool/blob/master/docs/images/wureset.png?raw=true" alt="Logo" height="300" width="300">
</a>
</div>
<br />
<div align="center">
<a href="#changelog">
<img src="https://img.shields.io/badge/stability-frozen-blue.svg" alt="Status">
</a>
<a href="#changelog">
<img src="https://img.shields.io/badge/release-v10.5.3.7-blue.svg" alt="Version">
</a>
<a href="#changelog">
<img src="https://img.shields.io/badge/update-juny-yellowgreen.svg" alt="Update">
</a>
<a href="https://gallery.technet.microsoft.com/scriptcenter/Reset-Windows-Update-Agent-d824badc" target="_blank">
<img src="https://img.shields.io/badge/downloads-%2B500K-green.svg" alt="License">
</a>
<a href="#license">
<img src="https://img.shields.io/badge/license-MIT%20License-green.svg" alt="License">
</a>
</div>
<div align="center">
<a href="https://twitter.com/intent/follow?screen_name=wureset">
<img src="https://img.shields.io/twitter/follow/wureset.svg?style=social" alt="Twitter">
</a>
</div>
<br />
<div align="center">
<a href="https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet">
<img src="https://github.com/ManuelGil/Reset-Windows-Update-Tool/blob/master/docs/images/Windows-Update.png?raw=true" alt="Lifecycle">
</a>
</div>
<br />
This script reset the Windows Update Components.
<a name="started"></a>
## :traffic_light: Getting Started
This page will help you get started with Reset Windows Update Tool (Script).
<a name="requirements"></a>
### Requirements
* Microsoft Windows XP or later
<a name="installation"></a>
### Installation
* This file don't require installation
<a name="support"></a>
### Support
* Issues: [https://github.com/ManuelGil/Reset-Windows-Update-Tool/issues](https://github.com/ManuelGil/Reset-Windows-Update-Tool/issues)
* Wiki: [https://github.com/ManuelGil/Reset-Windows-Update-Tool/wiki](https://github.com/ManuelGil/Reset-Windows-Update-Tool/wiki)
* Docs: [http://docs.wureset.com](http://docs.wureset.com)
<a name="Donate"></a>
## :gift: Donate!
If you want to help me to continue this project, you might donate via PayPal.
<a href="https://paypal.me/ManuelFGil"><img src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_donate_92x26.png" alt="Donate via PayPal"></a>
<a name="changelog"></a>
## :information_source: Changelog
**10.5.3.7** (06/04/2019)
* <table border="0" cellpadding="4">
<tr>
<td><strong>
Requirements:
</strong></td>
<td>
Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1
and Windows 10
</td>
</tr>
<tr>
<td>
<strong>Filename:</strong>
</td>
<td>
<a href="https://github.com/ManuelGil/Script-Reset-Windows-Update-Tool">
ResetWUEng.cmd
</a>
</td>
</tr>
<tr>
<td>
<strong>Changes:</strong>
</td>
<td>
<ul>
<li>
Add the standalone diagnostic tool <a href="https://go.microsoft.com/fwlink/?linkid=870142" target="_blank">SetupDiag</a>
</li>
</ul>
</td>
</tr>
</table>
**10.5.3.6** (06/07/2018) [+500K Downloads Celebration](https://gallery.technet.microsoft.com/scriptcenter/Reset-Windows-Update-Agent-d824badc)
* <table border="0" cellpadding="4">
<tr>
<td><strong>
Requirements:
</strong></td>
<td>
Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1
and Windows 10
</td>
</tr>
<tr>
<td>
<strong>Filename:</strong>
</td>
<td>
<a href="https://github.com/ManuelGil/Script-Reset-Windows-Update-Tool">
ResetWUEng.cmd
</a>
</td>
</tr>
<tr>
<td>
<strong>Changes:</strong>
</td>
<td>
<ul>
<li>
Verification of services restore
</li>
<li>
Force Group Policy Update.
</li>
</ul>
</td>
</tr>
</table>
**10.5.3.5** (12/22/2017)
* <table border="0" cellpadding="4">
<tr>
<td><strong>
Requirements:
</strong></td>
<td>
Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1
and Windows 10
</td>
</tr>
<tr>
<td>
<strong>Filename:</strong>
</td>
<td>
<a href="https://github.com/ManuelGil/Script-Reset-Windows-Update-Tool">
ResetWUEng.cmd
</a>
</td>
</tr>
<tr>
<td>
<strong>Changes:</strong>
</td>
<td>
<ul>
<li>
Link to official website
</li>
</ul>
</td>
</tr>
</table>
**10.5.3.4** (11/27/2017)
* <table border="0" cellpadding="4">
<tr>
<td><strong>
Requirements:
</strong></td>
<td>
Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1
and Windows 10
</td>
</tr>
<tr>
<td>
<strong>Filename:</strong>
</td>
<td>
<a href="https://github.com/ManuelGil/Script-Reset-Windows-Update-Tool">
ResetWUEng.cmd
</a>
</td>
</tr>
<tr>
<td>
<strong>Changes:</strong>
</td>
<td>
<ul>
<li>
Correction of texts in the menus
</li>
<li>
Verification of errors in the hard disk
</li>
<li>
Checking when renaming the 'SoftwareDistribution' folder
</li>
</ul>
</td>
</tr>
</table>
**10.5.3.3** (07/23/2017)
* <table border="0" cellpadding="4">
<tr>
<td><strong>
Requirements:
</strong></td>
<td>
Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1
and Windows 10
</td>
</tr>
<tr>
<td>
<strong>Filename:</strong>
</td>
<td>
<a href="https://github.com/ManuelGil/Script-Reset-Windows-Update-Tool">
ResetWUEng.cmd
</a>
</td>
</tr>
<tr>
<td>
<strong>Changes:</strong>
</td>
<td>
<ul>
<li>
Compatibility with all versions of Windows 10
(includes technical preview)
</li>
</ul>
</td>
</tr>
</table>
<a name="contributing"></a>
## :octocat: Contributing [![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/ManuelGil/Reset-Windows-Update-Tool/issues)
Please read [CONTRIBUTING.md](https://github.com/ManuelGil/Reset-Windows-Update-Tool/blob/master/CONTRIBUTING.md)
for details on our code of conduct.
<a name="authors"></a>
## :eyeglasses: Authors
* **Manuel Gil** - *Owner* - [ManuelGil](https://github.com/ManuelGil)
See also the list of [contributors](https://github.com/ManuelGil/Script-Reset-Windows-Update-Tool/contributors)
who participated in this project.
<a name="license"></a>
## :memo: License
Reset Windows Update Tool (Script) is licensed under the MIT License - see the
[MIT License](https://opensource.org/licenses/MIT) for details.

View File

@@ -1,8 +1,9 @@
:: ================================================================================== :: ==================================================================================
:: NAME: Reset Windows Update Tool. :: NAME: Reset Windows Update Tool.
:: DESCRIPTION: This script reset the Windows Update Components. :: DESCRIPTION: This script reset the Windows Update Components.
:: AUTHOR: Manuel Gil. :: AUTHOR: Manuel Gil.
:: VERSION: 10.5.3.2 :: VERSION: 10.5.3.7
:: WEBSITE: http://wureset.com
:: ================================================================================== :: ==================================================================================
@@ -12,7 +13,7 @@
:mode :mode
echo off echo off
title Reset Windows Update Tool. title Reset Windows Update Tool.
mode con cols=78 lines=32 mode con cols=80 lines=34
color 17 color 17
cls cls
@@ -127,30 +128,11 @@ goto :eof
set family=8 set family=8
:: Compatibility: Yes :: Compatibility: Yes
set allow=Yes set allow=Yes
) else if %version% EQU 10.0.10240 ( ) else (
:: Name: "Microsoft Windows 10 Threshold 1" ver | find "10.0." > nul
set name=Microsoft Windows 10 Threshold 1 if %errorlevel% EQU 0 (
:: Family: Windows 10 :: Name: "Microsoft Windows 10"
set family=10 set name=Microsoft Windows 10
:: Compatibility: Yes
set allow=Yes
) else if %version% EQU 10.0.10586 (
:: Name: "Microsoft Windows 10 Threshold 2"
set name=Microsoft Windows 10 Threshold 2
:: Family: Windows 10
set family=10
:: Compatibility: Yes
set allow=Yes
) else if %version% EQU 10.0.14393 (
:: Name: "Microsoft Windows 10 Redstone 1"
set name=Microsoft Windows 10 Redstone 1
:: Family: Windows 10
set family=10
:: Compatibility: Yes
set allow=Yes
) else if %version% EQU 10.0.15063 (
:: Name: "Microsoft Windows 10 Creators Update"
set name=Microsoft Windows 10 Creators Update
:: Family: Windows 10 :: Family: Windows 10
set family=10 set family=10
:: Compatibility: Yes :: Compatibility: Yes
@@ -161,6 +143,7 @@ goto :eof
:: Compatibility: No :: Compatibility: No
set allow=No set allow=No
) )
)
call :print %name% detected . . . call :print %name% detected . . .
@@ -171,7 +154,8 @@ goto :eof
echo. An error occurred while attempting to verify your system. echo. An error occurred while attempting to verify your system.
echo. Can this using a business or test version. echo. Can this using a business or test version.
echo. echo.
echo. If not, verify that your system has the correct security fix. echo. if not, verify that your system has the correct security fix.
echo. echo.
echo.Press any key to continue . . . echo.Press any key to continue . . .
@@ -219,16 +203,19 @@ goto :eof
echo. to review the code if you're unsure. echo. to review the code if you're unsure.
echo. echo.
choice /c YN /n /m "Do you want to continue with this process? (Yes/No) " choice /c YN /n /m "Do you want to continue with this process? (Y/N) "
if %errorlevel% EQU 1 goto menu if %errorlevel% EQU 1 (
if %errorlevel% EQU 2 goto close goto menu
) else if %errorlevel% EQU 2 (
goto close
) else if %errorlevel% EQU 9009 (
echo.
echo.An unexpected error has occurred. echo.An unexpected error has occurred.
echo. echo.
echo.Press any key to continue . . . echo.Press any key to continue . . .
pause>nul pause>nul
goto menu goto menu
)
goto :eof goto :eof
:: /*************************************************************************************/ :: /*************************************************************************************/
@@ -239,22 +226,25 @@ goto :eof
:menu :menu
call :print This tool reset the Windows Update Components. call :print This tool reset the Windows Update Components.
echo. 1. Open the system protection. echo. 1. Opens the system protection.
echo. 2. Reset Windows Update Components. echo. 2. Resets the Windows Update Components.
echo. 3. Delete temporary files in Windows. echo. 3. Deletes the temporary files in Windows.
echo. 4. Open the Internet Explorer options. echo. 4. Opens the Internet Explorer options.
echo. 5. Scans all protected system files. echo. 5. Runs Chkdsk on the Windows partition.
echo. 6. Scan the image to check for corruption. echo. 6. Runs the System File Checker tool.
echo. 7. Check the detected corruptions. echo. 7. Scans the image for component store corruption.
echo. 8. Repair the image. echo. 8. Checks whether the image has been flagged as corrupted.
echo. 9. Clean up the superseded components. echo. 9. Performs repair operations automatically.
echo. 10. Change invalid values in the Registry. echo. 10. Cleans up the superseded components.
echo. 11. Reset the Winsock settings. echo. 11. Deletes any incorrect registry values.
echo. 12. Search updates. echo. 12. Repairs/Resets Winsock settings.
echo. 13. Explore other local solutions. echo. 13. Forces Group Policy Update.
echo. 14. Explore other online solutions. echo. 14. Searches Windows updates.
echo. 15. Download Diagnostic. echo. 15. Runs SetupDiag (Require .NET Framework 4.6).
echo. 16. Restart your PC. echo. 16. Explores other local solutions.
echo. 17. Explores other online solutions.
echo. 18. Downloads the Diagnostic Tools.
echo. 19. Restarts your PC.
echo. echo.
echo. ?. Help. 0. Close. echo. ?. Help. 0. Close.
echo. echo.
@@ -272,28 +262,34 @@ goto :eof
) else if %option% EQU 4 ( ) else if %option% EQU 4 (
call :iOptions call :iOptions
) else if %option% EQU 5 ( ) else if %option% EQU 5 (
call :sfc call :chkdsk
) else if %option% EQU 6 ( ) else if %option% EQU 6 (
call :dism1 call :sfc
) else if %option% EQU 7 ( ) else if %option% EQU 7 (
call :dism2 call :dism1
) else if %option% EQU 8 ( ) else if %option% EQU 8 (
call :dism3 call :dism2
) else if %option% EQU 9 ( ) else if %option% EQU 9 (
call :dism4 call :dism3
) else if %option% EQU 10 ( ) else if %option% EQU 10 (
call :regedit call :dism4
) else if %option% EQU 11 ( ) else if %option% EQU 11 (
call :winsock call :regedit
) else if %option% EQU 12 ( ) else if %option% EQU 12 (
call :updates call :winsock
) else if %option% EQU 13 ( ) else if %option% EQU 13 (
call :local call :gpupdate
) else if %option% EQU 14 ( ) else if %option% EQU 14 (
call :online call :updates
) else if %option% EQU 15 ( ) else if %option% EQU 15 (
call :diagnostic call :setupDiag
) else if %option% EQU 16 ( ) else if %option% EQU 16 (
call :local
) else if %option% EQU 17 (
call :online
) else if %option% EQU 18 (
call :diagnostic
) else if %option% EQU 19 (
call :restart call :restart
) else if %option% EQU ? ( ) else if %option% EQU ? (
call :help call :help
@@ -346,16 +342,19 @@ goto :eof
call :print Stopping the Windows Update services. call :print Stopping the Windows Update services.
net stop cryptsvc net stop cryptsvc
call :print Canceling the Windows Update process.
taskkill /im wuauclt.exe /f
:: ----- Checking the services status ----- :: ----- Checking the services status -----
call :print Checking the services status. call :print Checking the services status.
sc query bits | findstr /I /C:"STOPPED" sc query bits | findstr /I /C:"STOPPED"
If %errorlevel% NEQ 0 ( if %errorlevel% NEQ 0 (
echo. Failed to stop the BITS service. echo. Failed to stop the BITS service.
echo. echo.
echo.Press any key to continue . . . echo.Press any key to continue . . .
pause>nul pause>nul
goto close goto :eof
) )
call :print Checking the services status. call :print Checking the services status.
@@ -366,7 +365,7 @@ goto :eof
echo. echo.
echo.Press any key to continue . . . echo.Press any key to continue . . .
pause>nul pause>nul
goto close goto :eof
) )
call :print Checking the services status. call :print Checking the services status.
@@ -379,19 +378,19 @@ goto :eof
echo. echo.
echo.Press any key to continue . . . echo.Press any key to continue . . .
pause>nul pause>nul
if %family% NEQ 6 goto close if %family% NEQ 6 goto :eof
) )
) )
call :print Checking the services status. call :print Checking the services status.
sc query cryptsvc | findstr /I /C:"STOPPED" sc query cryptsvc | findstr /I /C:"STOPPED"
If %errorlevel% NEQ 0 ( if %errorlevel% NEQ 0 (
echo. Failed to stop the Cryptographic Services service. echo. Failed to stop the Cryptographic Services service.
echo. echo.
echo.Press any key to continue . . . echo.Press any key to continue . . .
pause>nul pause>nul
goto close goto :eof
) )
:: ----- Delete the qmgr*.dat files ----- :: ----- Delete the qmgr*.dat files -----
@@ -428,6 +427,14 @@ goto :eof
if exist "%SYSTEMROOT%\SoftwareDistribution" ( if exist "%SYSTEMROOT%\SoftwareDistribution" (
attrib -r -s -h /s /d "%SYSTEMROOT%\SoftwareDistribution" attrib -r -s -h /s /d "%SYSTEMROOT%\SoftwareDistribution"
ren "%SYSTEMROOT%\SoftwareDistribution" SoftwareDistribution.bak ren "%SYSTEMROOT%\SoftwareDistribution" SoftwareDistribution.bak
if exist "%SYSTEMROOT%\SoftwareDistribution" (
echo.
echo. Failed to rename the SoftwareDistribution folder.
echo.
echo.Press any key to continue . . .
pause>nul
goto :eof
)
) )
if exist "%SYSTEMROOT%\system32\Catroot2" ( if exist "%SYSTEMROOT%\system32\Catroot2" (
attrib -r -s -h /s /d "%SYSTEMROOT%\system32\Catroot2" attrib -r -s -h /s /d "%SYSTEMROOT%\system32\Catroot2"
@@ -441,13 +448,15 @@ goto :eof
:: ----- Reset the BITS service and the Windows Update service to the default security descriptor ----- :: ----- 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. 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;;CCLCSWLOCRRC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLCRSDRCWDWO;;;SO)(A;;CCLCSWRPWPDTLOCRRC;;;SY)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;WD)
sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU) sc.exe sdset bits D:(A;;CCLCSWLOCRRC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLCRSDRCWDWO;;;SO)(A;;CCLCSWRPWPDTLOCRRC;;;SY)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;WD)
sc.exe sdset cryptsvc D:(A;;CCLCSWLOCRRC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLCRSDRCWDWO;;;SO)(A;;CCLCSWRPWPDTLOCRRC;;;SY)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;WD)
sc.exe sdset trustedinstaller D:(A;;CCLCSWLOCRRC;;;AU)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCDCLCSWRPWPDTLCRSDRCWDWO;;;SO)(A;;CCLCSWRPWPDTLOCRRC;;;SY)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;WD)
:: ----- Reregister the BITS files and the Windows Update files ----- :: ----- Reregister the BITS files and the Windows Update files -----
call :print Reregister the BITS files and the Windows Update files. call :print Reregister the BITS files and the Windows Update files.
cd /d %WINDIR%\system32 cd /d %SYSTEMROOT%\system32
regsvr32.exe /s atl.dll regsvr32.exe /s atl.dll
regsvr32.exe /s urlmon.dll regsvr32.exe /s urlmon.dll
regsvr32.exe /s mshtml.dll regsvr32.exe /s mshtml.dll
@@ -500,9 +509,11 @@ goto :eof
:: ----- Set the startup type as automatic ----- :: ----- Set the startup type as automatic -----
call :print Resetting the services as automatics. call :print Resetting the services as automatics.
sc config wuauserv start= auto sc.exe config wuauserv start= auto
sc config bits start= auto sc.exe config bits start= delayed-auto
sc config DcomLaunch start= auto sc.exe config cryptsvc start= auto
sc.exe config TrustedInstaller start= demand
sc.exe config DcomLaunch start= auto
:: ----- Starting the Windows Update services ----- :: ----- Starting the Windows Update services -----
call :print Starting the Windows Update services. call :print Starting the Windows Update services.
@@ -533,7 +544,7 @@ goto :eof
:: void temp(); :: void temp();
:: /*************************************************************************************/ :: /*************************************************************************************/
:temp :temp
call :print Deleting temporary files in Windows. call :print Deleting the temporary files in Windows.
del /s /f /q "%TEMP%\*.*" del /s /f /q "%TEMP%\*.*"
del /s /f /q "%SYSTEMROOT%\Temp\*.*" del /s /f /q "%SYSTEMROOT%\Temp\*.*"
@@ -556,11 +567,34 @@ goto :eof
:: /*************************************************************************************/ :: /*************************************************************************************/
:: Check and repair errors on the disk.
:: void chkdsk();
:: /*************************************************************************************/
:chkdsk
call :print Check the file system and file system metadata of a volume for logical and physical errors (CHKDSK.exe).
chkdsk %SYSTEMDRIVE% /f /r
if %errorlevel% EQU 0 (
echo.
echo.The operation completed successfully.
) else (
echo.
echo.An error occurred during operation.
)
echo.
echo.Press any key to continue . . .
pause>nul
goto :eof
:: /*************************************************************************************/
:: Scans all protected system files. :: Scans all protected system files.
:: void sfc(); :: void sfc();
:: /*************************************************************************************/ :: /*************************************************************************************/
:sfc :sfc
call :print Scans all protected system files. call :print Scan your system files and to repair missing or corrupted system files (SFC.exe).
if %family% NEQ 5 ( if %family% NEQ 5 (
sfc /scannow sfc /scannow
@@ -568,7 +602,7 @@ goto :eof
echo.Sorry, this option is not available on this Operative System. echo.Sorry, this option is not available on this Operative System.
) )
If %errorlevel% EQU 0 ( if %errorlevel% EQU 0 (
echo. echo.
echo.The operation completed successfully. echo.The operation completed successfully.
) else ( ) else (
@@ -587,7 +621,7 @@ goto :eof
:: void dism1(); :: void dism1();
:: /*************************************************************************************/ :: /*************************************************************************************/
:dism1 :dism1
call :print Scanning the image to check for corruption. call :print Scan the image for component store corruption (The DISM /ScanHealth argument).
if %family% EQU 8 ( if %family% EQU 8 (
Dism.exe /Online /Cleanup-Image /ScanHealth Dism.exe /Online /Cleanup-Image /ScanHealth
@@ -597,7 +631,7 @@ goto :eof
echo.Sorry, this option is not available on this Operative System. echo.Sorry, this option is not available on this Operative System.
) )
If %errorlevel% EQU 0 ( if %errorlevel% EQU 0 (
echo. echo.
echo.The operation completed successfully. echo.The operation completed successfully.
) else ( ) else (
@@ -616,7 +650,7 @@ goto :eof
:: void dism2(); :: void dism2();
:: /*************************************************************************************/ :: /*************************************************************************************/
:dism2 :dism2
call :print Checking the detected corruptions. call :print Check whether the image has been flagged as corrupted by a failed process and whether the corruption can be repaired (The DISM /CheckHealth argument).
if %family% EQU 8 ( if %family% EQU 8 (
Dism.exe /Online /Cleanup-Image /CheckHealth Dism.exe /Online /Cleanup-Image /CheckHealth
@@ -626,7 +660,7 @@ goto :eof
echo.Sorry, this option is not available on this Operative System. echo.Sorry, this option is not available on this Operative System.
) )
If %errorlevel% EQU 0 ( if %errorlevel% EQU 0 (
echo. echo.
echo.The operation completed successfully. echo.The operation completed successfully.
) else ( ) else (
@@ -641,11 +675,11 @@ goto :eof
:: /*************************************************************************************/ :: /*************************************************************************************/
:: Repair the image. :: Repair the Windows image.
:: void dism3(); :: void dism3();
:: /*************************************************************************************/ :: /*************************************************************************************/
:dism3 :dism3
call :print Repairing the image. call :print Scan the image for component store corruption, and then perform repair operations automatically (The DISM /RestoreHealth argument).
if %family% EQU 8 ( if %family% EQU 8 (
Dism.exe /Online /Cleanup-Image /RestoreHealth Dism.exe /Online /Cleanup-Image /RestoreHealth
@@ -655,7 +689,7 @@ goto :eof
echo.Sorry, this option is not available on this Operative System. echo.Sorry, this option is not available on this Operative System.
) )
If %errorlevel% EQU 0 ( if %errorlevel% EQU 0 (
echo. echo.
echo.The operation completed successfully. echo.The operation completed successfully.
) else ( ) else (
@@ -670,11 +704,11 @@ goto :eof
:: /*************************************************************************************/ :: /*************************************************************************************/
:: Clean up the superseded components . :: Clean up the superseded components.
:: void dism4(); :: void dism4();
:: /*************************************************************************************/ :: /*************************************************************************************/
:dism4 :dism4
call :print Clean up the superseded components. call :print Clean up the superseded components and reduce the size of the component store (The DISM /StartComponentCleanup argument).
if %family% EQU 8 ( if %family% EQU 8 (
Dism.exe /Online /Cleanup-Image /StartComponentCleanup Dism.exe /Online /Cleanup-Image /StartComponentCleanup
@@ -684,7 +718,7 @@ goto :eof
echo.Sorry, this option is not available on this Operative System. echo.Sorry, this option is not available on this Operative System.
) )
If %errorlevel% EQU 0 ( if %errorlevel% EQU 0 (
echo. echo.
echo.The operation completed successfully. echo.The operation completed successfully.
) else ( ) else (
@@ -703,14 +737,18 @@ goto :eof
:: void regedit(); :: void regedit();
:: /*************************************************************************************/ :: /*************************************************************************************/
:regedit :regedit
for /f "tokens=1-5 delims=/, " %%a in ("%date%") do ( for /f "tokens=1-5 delims=/., " %%a in ("%date%") do (
set now=%%a%%b%%c%%d%time:~0,2%%time:~3,2% set now=%%a%%b%%c%%d%time:~0,2%%time:~3,2%
) )
:: ----- Create a backup of the Registry ----- if not exist "%USERPROFILE%\Desktop\Backup\Regedit\%now%\" (
call :print Making a backup copy of the Registry in: %USERPROFILE%\Desktop\Backup%now%.reg mkdir "%USERPROFILE%\Desktop\Backup\Regedit\%now%\"
)
if exist "%USERPROFILE%\Desktop\Backup%now%.reg" ( :: ----- Create a backup of the Registry -----
call :print Making a backup of the Registry in: %USERPROFILE%\Desktop\Backup\Regedit\%now%\
if exist "%USERPROFILE%\Desktop\Backup\Regedit\%now%\HKLM.reg" (
echo.An unexpected error has occurred. echo.An unexpected error has occurred.
echo. echo.
echo. Changes were not carried out in the registry. echo. Changes were not carried out in the registry.
@@ -720,13 +758,17 @@ goto :eof
pause>nul pause>nul
goto :eof goto :eof
) else ( ) else (
regedit /e "%USERPROFILE%\Desktop\Backup%now%.reg" reg Export HKCR "%USERPROFILE%\Desktop\Backup\Regedit\%now%\HKCR.reg"
reg Export HKCU "%USERPROFILE%\Desktop\Backup\Regedit\%now%\HKCU.reg"
reg Export HKLM "%USERPROFILE%\Desktop\Backup\Regedit\%now%\HKLM.reg"
reg Export HKU "%USERPROFILE%\Desktop\Backup\Regedit\%now%\HKU.reg"
reg Export HKCC "%USERPROFILE%\Desktop\Backup\Regedit\%now%\HKCC.reg"
) )
:: ----- Checking backup ----- :: ----- Checking backup -----
call :print Checking the backup copy. call :print Checking the backup.
if not exist "%USERPROFILE%\Desktop\Backup%now%.reg" ( if not exist "%USERPROFILE%\Desktop\Backup\Regedit\%now%\HKLM.reg" (
echo.An unexpected error has occurred. echo.An unexpected error has occurred.
echo. echo.
echo. Something went wrong. echo. Something went wrong.
@@ -742,12 +784,40 @@ goto :eof
:: ----- Delete keys in the Registry ----- :: ----- Delete keys in the Registry -----
call :print Deleting values in the Registry. call :print Deleting values in the Registry.
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /f
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\WindowsUpdate" /f
reg delete "HKCU\Software\Microsoft\WindowsSelfHost" /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate" /f
reg delete "HKLM\Software\Microsoft\WindowsSelfHost" /f
reg delete "HKLM\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" /f
reg delete "HKLM\COMPONENTS\PendingXmlIdentifier" /f reg delete "HKLM\COMPONENTS\PendingXmlIdentifier" /f
reg delete "HKLM\COMPONENTS\NextQueueEntryIndex" /f reg delete "HKLM\COMPONENTS\NextQueueEntryIndex" /f
reg delete "HKLM\COMPONENTS\AdvancedInstallersNeedResolving" /f reg delete "HKLM\COMPONENTS\AdvancedInstallersNeedResolving" /f
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v ResetClient /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v ResetDataStoreReason /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v PingID /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v AccountDomainSid /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientId /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate" /v SusClientIDValidation /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUState /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v LastWaitTimeout /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v DetectionstartTime /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v NextDetectionTime /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" /f reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Reporting" /v SamplingValue /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services" /v ReregisterAuthorizationCab /f
:: ----- Add keys in the Registry ----- :: ----- Add keys in the Registry -----
call :print Adding values in the Registry. call :print Adding values in the Registry.
@@ -842,6 +912,33 @@ goto :eof
:: /*************************************************************************************/ :: /*************************************************************************************/
:: Forcing group policy update.
:: void gpupdate();
:: /*************************************************************************************/
:gpupdate
call :print Forcing group policy update.
if %family% NEQ 5 (
gpupdate /force
) else (
echo.Sorry, this option is not available on this Operative System.
)
if %errorlevel% EQU 0 (
echo.
echo.The operation completed successfully.
) else (
echo.
echo.An error occurred during operation.
)
echo.
echo.Press any key to continue . . .
pause>nul
goto :eof
:: /*************************************************************************************/
:: Search Updates. :: Search Updates.
:: void updates(); :: void updates();
:: /*************************************************************************************/ :: /*************************************************************************************/
@@ -854,7 +951,7 @@ goto :eof
wuauclt /resetauthorization /detectnow wuauclt /resetauthorization /detectnow
if %family% EQU 10 ( if %family% EQU 10 (
start ms-settings:windowsupdate start ms-settings:windowsupdate-action
) else ( ) else (
if %family% NEQ 5 ( if %family% NEQ 5 (
start wuapp.exe start wuapp.exe
@@ -870,6 +967,33 @@ goto :eof
:: /*************************************************************************************/ :: /*************************************************************************************/
:: Run SetupDiag.
:: void setupDiag();
:: /*************************************************************************************/
:setupDiag
for /f "tokens=1-5 delims=/., " %%a in ("%date%") do (
set now=%%a%%b%%c%%d%time:~0,2%%time:~3,2%
)
if not exist "%USERPROFILE%\Desktop\Backup\Logs\%now%\" (
mkdir "%USERPROFILE%\Desktop\Backup\Logs\%now%\"
)
call :print Running the standalone diagnostic tool SetupDiag
if %family% EQU 10 (
call "%~dp0SetupDiag.exe" /Output:"%USERPROFILE%\Desktop\Backup\Logs\%now%\WindowsUpdate.log" /Format:log
) else (
echo.Sorry, this option is not available on this Operative System.
)
echo.
echo.Press any key to continue . . .
pause>nul
goto :eof
:: /*************************************************************************************/
:: Explore other local solutions. :: Explore other local solutions.
:: void local(); :: void local();
:: /*************************************************************************************/ :: /*************************************************************************************/
@@ -925,7 +1049,7 @@ goto :eof
:: void help(); :: void help();
:: /*************************************************************************************/ :: /*************************************************************************************/
:help :help
start %~dp0Help.chm start http://docs.wureset.com/
goto :eof goto :eof
:: /*************************************************************************************/ :: /*************************************************************************************/
@@ -940,7 +1064,6 @@ goto :eof
echo. 2. Windows Update on Windows 10. echo. 2. Windows Update on Windows 10.
echo. 3. Apps on Windows 8.1. echo. 3. Apps on Windows 8.1.
echo. 4. Apps on Windows 10. echo. 4. Apps on Windows 10.
echo. 5. Start Menu on Windows 10.
echo. echo.
echo. 0. Back. echo. 0. Back.
echo. echo.
@@ -957,8 +1080,6 @@ goto :eof
start http://go.microsoft.com/fwlink/p/?LinkId=268423 start http://go.microsoft.com/fwlink/p/?LinkId=268423
) else if %option% EQU 4 ( ) else if %option% EQU 4 (
start http://aka.ms/diag_apps10 start http://aka.ms/diag_apps10
) else if %option% EQU 5 (
start http://aka.ms/startmenuTS
) else ( ) else (
echo. echo.
echo.Invalid option. echo.Invalid option.