Full-DISM-With Fix Windows-Update.bat

Various changes to the Windows Operating System, also for the Intranet

Moderator: sjj1805

Post Reply
User avatar
sjj1805
Site Admin
Posts: 1194
Joined: Fri Oct 27, 2006 12:45 am
operating_system: Windows 10 Pro
motherboard: Hewlett Packard 2AF7
system_drive: C
32bit or 64bit: 64 Bit
processor: 2-90 gigahertz Intel Core i5 4460S
ram: 8 GB
video card: NVIDIA GeForce GT 705
sound card: P40D100-4 NVIDIA High Definition Audio
Hard_Drive_Capacity: 8 TB
Location: Birmingham UK
Contact:

Full-DISM-With Fix Windows-Update.bat

Post by sjj1805 » Sun Jul 31, 2022 1:41 am

Copy the following into Windows Notepad and give it a "BAT" extension, then run as an Administrator

Code: Select all

attrib -h -r -s %windir%\system32\catroot2
attrib -h -r -s %windir%\system32\catroot2\*.*
echo Stopping Windows Update related services...
echo ===========================================
echo.
net stop wuauserv
net stop CryptSvc
net stop BITS
echo Done!
echo.
echo Renaming Windows Update related folders...
echo ==========================================
echo.
ren %windir%\system32\catroot2 catroot2.old 
ren %windir%\SoftwareDistribution sold.old
ren "%ALLUSERSPROFILE%\application data\Microsoft\Network\downloader" downloader.old
echo Done!
echo.
echo Starting Windows Update related services...
echo ===========================================
echo.
net Start BITS
net start CryptSvc
net start wuauserv
echo Done!
echo.
echo Task completed successfully...
echo.
dism.exe /online /cleanup-image /checkhealth
dism.exe /online /cleanup-image /scanhealth
dism.exe /online /cleanup-image /restorehealth
sfc /scannow
dism.exe /online /cleanup-image /AnalyzeComponentStore
dism.exe /online /cleanup-image /StartComponentCleanup
if not exist D:\$RECYCLE.BIN goto step2
echo y|chkdsk /f D:
:Step2
if not exist H:\$RECYCLE.BIN goto step3
echo y|chkdsk /f H:
:Step3
if not exist M:\$RECYCLE.BIN goto step4
echo y|chkdsk /f M:
:Step4
if not exist P:\$RECYCLE.BIN goto step5
echo y|chkdsk /f P:
:Step5
if not exist V:\$RECYCLE.BIN goto step6
echo y|chkdsk /f V:
:Step6
chkdsk.exe c:
if ERRORLEVEL 2 goto ADD_CHECK
echo.
echo The drive is okay this time.
goto end
:ADD_CHECK

reg ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager" /v BootExecute /t REG_MULTI_SZ /d "autocheck autochk /p \??\C:\0autocheck autochk *" /f
echo.
echo The C drive has problems Please run chkdsk next boot

pause
:end

Post Reply