mirror of
https://github.com/ManuelGil/Script-Reset-Windows-Update-Tool.git
synced 2026-08-18 15:33:35 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8755b57387 | ||
|
|
8f6a35cb41 | ||
|
|
fd3d6648ea | ||
|
|
7bedd614bc | ||
|
|
fc9dbdb6c2 | ||
|
|
218af1b70f |
174
README.md
Normal file
174
README.md
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
<div align="center">
|
||||||
|
<h1> Reset Windows Update Tool (Script) </h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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.5-blue.svg" alt="Version">
|
||||||
|
</a>
|
||||||
|
<a href="#changelog">
|
||||||
|
<img src="https://img.shields.io/badge/update-december-yellowgreen.svg" alt="Update">
|
||||||
|
</a>
|
||||||
|
<a href="#license">
|
||||||
|
<img src="https://img.shields.io/badge/license-MIT%20License-green.svg" alt="License">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
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="changelog"></a>
|
||||||
|
## :information_source: Changelog
|
||||||
|
|
||||||
|
**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="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="authors"></a>
|
||||||
|
## :eyeglasses: Authors
|
||||||
|
|
||||||
|
* **Manuel Gil** - *Initial work* - [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.
|
||||||
241
ResetWUEng.cmd
241
ResetWUEng.cmd
@@ -2,7 +2,7 @@
|
|||||||
:: 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.5
|
||||||
:: ==================================================================================
|
:: ==================================================================================
|
||||||
|
|
||||||
|
|
||||||
@@ -127,39 +127,21 @@ 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 (
|
|
||||||
:: Name: "Microsoft Windows 10 Threshold 1"
|
|
||||||
set name=Microsoft Windows 10 Threshold 1
|
|
||||||
:: Family: Windows 10
|
|
||||||
set family=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
|
|
||||||
set family=10
|
|
||||||
:: Compatibility: Yes
|
|
||||||
set allow=Yes
|
|
||||||
) else (
|
) else (
|
||||||
:: Name: "Unknown"
|
ver | find "10.0." > nul
|
||||||
set name=Unknown
|
if %errorlevel% EQU 0 (
|
||||||
:: Compatibility: No
|
:: Name: "Microsoft Windows 10"
|
||||||
set allow=No
|
set name=Microsoft Windows 10
|
||||||
|
:: Family: Windows 10
|
||||||
|
set family=10
|
||||||
|
:: Compatibility: Yes
|
||||||
|
set allow=Yes
|
||||||
|
) else (
|
||||||
|
:: Name: "Unknown"
|
||||||
|
set name=Unknown
|
||||||
|
:: Compatibility: No
|
||||||
|
set allow=No
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
call :print %name% detected . . .
|
call :print %name% detected . . .
|
||||||
@@ -171,7 +153,7 @@ 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 +201,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 (
|
||||||
echo.An unexpected error has occurred.
|
goto close
|
||||||
echo.
|
) else if %errorlevel% EQU 9009 (
|
||||||
echo.Press any key to continue . . .
|
echo.
|
||||||
pause>nul
|
echo.An unexpected error has occurred.
|
||||||
|
echo.
|
||||||
goto menu
|
echo.Press any key to continue . . .
|
||||||
|
pause>nul
|
||||||
|
goto menu
|
||||||
|
)
|
||||||
goto :eof
|
goto :eof
|
||||||
:: /*************************************************************************************/
|
:: /*************************************************************************************/
|
||||||
|
|
||||||
@@ -239,22 +224,23 @@ 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. Searches Windows updates.
|
||||||
echo. 14. Explore other online solutions.
|
echo. 14. Explores other local solutions.
|
||||||
echo. 15. Download Diagnostic.
|
echo. 15. Explores other online solutions.
|
||||||
echo. 16. Restart your PC.
|
echo. 16. Downloads the Diagnostic Tools.
|
||||||
|
echo. 17. Restarts your PC.
|
||||||
echo.
|
echo.
|
||||||
echo. ?. Help. 0. Close.
|
echo. ?. Help. 0. Close.
|
||||||
echo.
|
echo.
|
||||||
@@ -272,28 +258,30 @@ 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 :updates
|
||||||
) else if %option% EQU 14 (
|
) else if %option% EQU 14 (
|
||||||
call :online
|
call :local
|
||||||
) else if %option% EQU 15 (
|
) else if %option% EQU 15 (
|
||||||
call :diagnostic
|
call :online
|
||||||
) else if %option% EQU 16 (
|
) else if %option% EQU 16 (
|
||||||
|
call :diagnostic
|
||||||
|
) else if %option% EQU 17 (
|
||||||
call :restart
|
call :restart
|
||||||
) else if %option% EQU ? (
|
) else if %option% EQU ? (
|
||||||
call :help
|
call :help
|
||||||
@@ -350,12 +338,12 @@ goto :eof
|
|||||||
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 +354,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 +367,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 +416,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"
|
||||||
@@ -447,7 +443,7 @@ goto :eof
|
|||||||
:: ----- 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
|
||||||
@@ -533,7 +529,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 +552,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 +587,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 +606,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 +616,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 +635,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 +645,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 +660,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 +674,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 +689,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 +703,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,12 +722,12 @@ 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 -----
|
:: ----- Create a backup of the Registry -----
|
||||||
call :print Making a backup copy of the Registry in: %USERPROFILE%\Desktop\Backup%now%.reg
|
call :print Making a backup of the Registry in: %USERPROFILE%\Desktop\Backup%now%.reg
|
||||||
|
|
||||||
if exist "%USERPROFILE%\Desktop\Backup%now%.reg" (
|
if exist "%USERPROFILE%\Desktop\Backup%now%.reg" (
|
||||||
echo.An unexpected error has occurred.
|
echo.An unexpected error has occurred.
|
||||||
@@ -724,7 +743,7 @@ goto :eof
|
|||||||
)
|
)
|
||||||
|
|
||||||
:: ----- 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%now%.reg" (
|
||||||
echo.An unexpected error has occurred.
|
echo.An unexpected error has occurred.
|
||||||
@@ -742,12 +761,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\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" /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\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.
|
||||||
|
|
||||||
@@ -925,7 +972,7 @@ goto :eof
|
|||||||
:: void help();
|
:: void help();
|
||||||
:: /*************************************************************************************/
|
:: /*************************************************************************************/
|
||||||
:help
|
:help
|
||||||
start %~dp0Help.chm
|
start http://docs.wureset.com/
|
||||||
goto :eof
|
goto :eof
|
||||||
:: /*************************************************************************************/
|
:: /*************************************************************************************/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user