Windows 10 / 11 post WU installation cleanup script


Hey, folks,

Thanks to a lot of wonderful folks here, we've made mention in a previous Insider topic about cleanup steps that can be run after Windows Update performs a major version install.

Though these have been mentioned before by many, many people, it was this post by @IanMosley that started me on implementing this as an step to clean up both my main Windows installation and all the VMs I have for testing:


A few posts later, @geneo offered some good advice on how to streamline that set of commands in this post:


Which, eventually, led me to mentioning that I had put them all in a batch file to run after major WU installs:


Thus far I've just been right clicking the file and selecting Run as Administrator to run it - not all that hard. But, today, I went in search of a self-elevation script for batch files so I can just double click the file and let it do its thing.

I found a good thread at Stack Overflow that has a few methods mentioned, including direct self-elevation, elevation via WSH, via VBScripting, and even via Powershell. I tested several ones, and found that this particular script works best and is no nonsense and has no fuss:


I've also added a pause command at the end so that the window remains on screen after completing so you can see the results, and a simple keypress will close it out.

So, here is the code as I'm using it now:

Batch:
:: Elevation script from StackOverflow
:: https://stackoverflow.com/a/28467343

:: Begin Elevation script

@ECHO OFF
setlocal EnableDelayedExpansion

::net file to test privileges, 1>NUL redirects output, 2>NUL redirects errors
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto START ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' ( goto START )

set "batchPath=%~f0"
set "batchArgs=ELEV"

::Add quotes to the batch path, if needed
set "script=%0"
set script=%script:"=%
IF '%0'=='!script!' ( GOTO PathQuotesDone )
    set "batchPath=""%batchPath%"""
:PathQuotesDone

::Add quotes to the arguments, if needed.
:ArgLoop
IF '%1'=='' ( GOTO EndArgLoop ) else ( GOTO AddArg )
    :AddArg
    set "arg=%1"
    set arg=%arg:"=%
    IF '%1'=='!arg!' ( GOTO NoQuotes )
        set "batchArgs=%batchArgs% "%1""
        GOTO QuotesDone
        :NoQuotes
        set "batchArgs=%batchArgs% %1"
    :QuotesDone
    shift
    GOTO ArgLoop
:EndArgLoop

::Create and run the vb script to elevate the batch file
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
ECHO UAC.ShellExecute "cmd", "/c ""!batchPath! !batchArgs!""", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B

:START
::Remove the elevation tag and set the correct working directory
IF '%1'=='ELEV' ( shift /1 )
cd /d %~dp0

::Do your adminy thing here...

:: End Elevation Script
:: Begin cleanup script

start /B /wait rundll32.exe pnpclean.dll,RunDLL_PnpClean /drivers/maxclean
start /B /wait dism /Online /Cleanup-Image /CheckHealth
start /B /wait sfc /scannow
start /B /wait dism /Online /Cleanup-Image /RestoreHealth
start /B /wait dism /online /Cleanup-Image /Startcomponentcleanup /resetbase

pause

You can copy the contents and save it to a file with a .BAT extension and it should work just fine, tested across Windows 10 and Windows 10 Insider Preview, plus Windows 11 (RTM, Release Preview, Beta, Dev and Canary current builds).

If you'd rather just download the batch file, here you go.

Download

Enjoy!

P.S. - if you have any suggestions on improving it / adding more functionality / expanding the scope of the cleanup, feel free to comment below!
 
Windows Build/Version
Windows 10 / Windows 11

Attachments

  • Post_WU_Cleanup.zip
    999 bytes · Views: 11
Last edited by a moderator:
I have run this script several times and not had any problems.
Today i get the following error messages..
Error 5
Access is denied.
If this isn't the place to ask the question please delete my post.
Any help would be most welcomed

The log shows this:
2024-01-06 10:00:58, Error DISM DISM Package Manager: PID=8052 TID=12892 get_CleanupSize: Failed to create the CBS Package enumeration. - CDISMPackageManager::get_CleanupSize(hr:0x80070002)
2024-01-06 10:00:58, Error DISM API: PID=3804 TID=19692 Get cleanupSize failed 80070002. - CGetUsedSpaceCommandObject::InternalExecute(hr:0x80070002)
2024-01-06 10:00:58, Error DISM API: PID=3804 TID=19692 InternalExecute failed - CBaseCommandObject::Execute(hr:0x80070002)
2024-01-06 10:00:58, Error DISM API: PID=3804 TID=4504 CCleanImageCommandObject internal execution failed - DismGetUsedSpaceInternal(hr:0x80070002)

and this:
2024-01-11 04:05:08, Error DISM DISM Package Manager: PID=16504 TID=20416 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x80070005)
2024-01-11 04:05:08, Error DISM DISM Package Manager: PID=16504 TID=20416 Failed processing package changes - CDISMPackageManager::StartComponentCleanupEx(hr:0x80070005)
2024-01-11 04:05:08, Error DISM DISM Package Manager: PID=16504 TID=20416 Failed to start component cleanup. - CPackageManagerCLIHandler::processCmdLine_CleanupImage(hr:0x80070005)
2024-01-11 04:05:08, Error DISM DISM Package Manager: PID=16504 TID=20416 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x80070005)
2024-01-11 04:05:08, Info DISM DISM Package Manager: PID=16504 TID=20416 Further logs for online package and feature related operations can be found at %WINDIR%\logs\CBS\cbs.log - CPackageManagerCLIHandler::ExecuteCmdLine
2024-01-11 04:05:08, Error DISM DISM.EXE: DISM Package Manager processed the command line but failed. HRESULT=80070005

and:
2024-01-11 04:13:30, Error DISM DISM Package Manager: PID=21428 TID=20972 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x80070005)
2024-01-11 04:13:30, Error DISM DISM Package Manager: PID=21428 TID=20972 Failed processing package changes - CDISMPackageManager::StartComponentCleanupEx(hr:0x80070005)
2024-01-11 04:13:30, Error DISM DISM Package Manager: PID=21428 TID=20972 Failed to start component cleanup. - CPackageManagerCLIHandler::processCmdLine_CleanupImage(hr:0x80070005)
2024-01-11 04:13:30, Error DISM DISM Package Manager: PID=21428 TID=20972 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x80070005)
2024-01-11 04:13:30, Info DISM DISM Package Manager: PID=21428 TID=20972 Further logs for online package and feature related operations can be found at %WINDIR%\logs\CBS\cbs.log - CPackageManagerCLIHandler::ExecuteCmdLine
2024-01-11 04:13:30, Error DISM DISM.EXE: DISM Package Manager processed the command line but failed. HRESULT=80070005
 

My Computer

System One

  • OS
    Win 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    N/A
    CPU
    AMD Ryzen 5 5600x
    Motherboard
    ASUS Crosshair Viii Hero Wi Fi
    Memory
    32 Gb DDR4 3600MHz GSkill
    Graphics Card(s)
    NVidia Geforce 950
    Sound Card
    USB Out NAD M51 DAC with Adams A8 speakers
    Monitor(s) Displays
    Dell 3219Q
    Screen Resolution
    3840 x 2160
    Hard Drives
    2 x Samsung EVO 970 1 Gb SSD
    PSU
    Seasonic 1200W
    Case
    CoolerMaster ATCS 840
    Cooling
    Noctua NH-U12S Chromax
    Keyboard
    Roccat FX
    Mouse
    Steel Series Rival 650 Wirelss
    Internet Speed
    Starlink 94Mbps down 20Mbps up
    Browser
    Brave
    Antivirus
    ESET
Hmmm. Seems there was an issue, but I'm not sure where to begin troubleshooting.

The usual suspects, sure:

  1. It automatically ran as admin, correct?
  2. Was this after a new build install? If so, did you reboot and then execute the script?
 

My Computers

System One System Two

  • OS
    Windows 11 23H2 Current build
    Computer type
    PC/Desktop
    Manufacturer/Model
    HomeBrew
    CPU
    AMD Ryzen 9 3950X
    Motherboard
    MSI MEG X570 GODLIKE
    Memory
    4 * 32 GB - Corsair Vengeance 3600 MHz
    Graphics Card(s)
    EVGA GeForce RTX 3080 Ti XC3 ULTRA GAMING (12G-P5-3955-KR)
    Sound Card
    Realtek® ALC1220 Codec
    Monitor(s) Displays
    2x Eve Spectrum ES07D03 4K Gaming Monitor (Matte) | Eve Spectrum ES07DC9 4K Gaming Monitor (Glossy)
    Screen Resolution
    3x 3840 x 2160
    Hard Drives
    3x Samsung 980 Pro NVMe PCIe 4 M.2 2 TB SSD (MZ-V8P2T0B/AM) } 3x Sabrent Rocket NVMe 4.0 1 TB SSD (USB)
    PSU
    PC Power & Cooling’s Silencer Series 1050 Watt, 80 Plus Platinum
    Case
    Fractal Design Define 7 XL Dark ATX Full Tower Case
    Cooling
    NZXT KRAKEN Z73 73.11 CFM Liquid CPU Cooler (3x 120 mm push top) + Air 3x 140mm case fans (pull front) + 1x 120 mm (push back) and 1 x 120 mm (pull bottom)
    Keyboard
    SteelSeries Apex Pro Wired Gaming Keyboard
    Mouse
    Logitech MX Master 3S | MX Master 3 for Business
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth
    Browser
    Nightly (default) + Firefox (stable), Chrome, Edge
    Antivirus
    Defender + MB 5 Beta
  • Operating System
    ChromeOS Flex Dev Channel (current)
    Computer type
    Laptop
    Manufacturer/Model
    Dell Latitude E5470
    CPU
    Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz, 2501 Mhz, 2 Core(s), 4 Logical Processor(s)
    Motherboard
    Dell
    Memory
    16 GB
    Graphics card(s)
    Intel(R) HD Graphics 520
    Sound Card
    Intel(R) HD Graphics 520 + RealTek Audio
    Monitor(s) Displays
    Dell laptop display 15"
    Screen Resolution
    1920 * 1080
    Hard Drives
    Toshiba 128GB M.2 22300 drive
    INTEL Cherryville 520 Series SSDSC2CW180A 180 GB SATA III SSD
    PSU
    Dell
    Case
    Dell
    Cooling
    Dell
    Mouse
    Logitech MX Master 3S (shared w. Sys 1) | Dell TouchPad
    Keyboard
    Dell
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth

My Computers

System One System Two

  • OS
    Windows 11 23H2 Current build
    Computer type
    PC/Desktop
    Manufacturer/Model
    HomeBrew
    CPU
    AMD Ryzen 9 3950X
    Motherboard
    MSI MEG X570 GODLIKE
    Memory
    4 * 32 GB - Corsair Vengeance 3600 MHz
    Graphics Card(s)
    EVGA GeForce RTX 3080 Ti XC3 ULTRA GAMING (12G-P5-3955-KR)
    Sound Card
    Realtek® ALC1220 Codec
    Monitor(s) Displays
    2x Eve Spectrum ES07D03 4K Gaming Monitor (Matte) | Eve Spectrum ES07DC9 4K Gaming Monitor (Glossy)
    Screen Resolution
    3x 3840 x 2160
    Hard Drives
    3x Samsung 980 Pro NVMe PCIe 4 M.2 2 TB SSD (MZ-V8P2T0B/AM) } 3x Sabrent Rocket NVMe 4.0 1 TB SSD (USB)
    PSU
    PC Power & Cooling’s Silencer Series 1050 Watt, 80 Plus Platinum
    Case
    Fractal Design Define 7 XL Dark ATX Full Tower Case
    Cooling
    NZXT KRAKEN Z73 73.11 CFM Liquid CPU Cooler (3x 120 mm push top) + Air 3x 140mm case fans (pull front) + 1x 120 mm (push back) and 1 x 120 mm (pull bottom)
    Keyboard
    SteelSeries Apex Pro Wired Gaming Keyboard
    Mouse
    Logitech MX Master 3S | MX Master 3 for Business
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth
    Browser
    Nightly (default) + Firefox (stable), Chrome, Edge
    Antivirus
    Defender + MB 5 Beta
  • Operating System
    ChromeOS Flex Dev Channel (current)
    Computer type
    Laptop
    Manufacturer/Model
    Dell Latitude E5470
    CPU
    Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz, 2501 Mhz, 2 Core(s), 4 Logical Processor(s)
    Motherboard
    Dell
    Memory
    16 GB
    Graphics card(s)
    Intel(R) HD Graphics 520
    Sound Card
    Intel(R) HD Graphics 520 + RealTek Audio
    Monitor(s) Displays
    Dell laptop display 15"
    Screen Resolution
    1920 * 1080
    Hard Drives
    Toshiba 128GB M.2 22300 drive
    INTEL Cherryville 520 Series SSDSC2CW180A 180 GB SATA III SSD
    PSU
    Dell
    Case
    Dell
    Cooling
    Dell
    Mouse
    Logitech MX Master 3S (shared w. Sys 1) | Dell TouchPad
    Keyboard
    Dell
    Internet Speed
    AT&T LightSpeed Gigabit Duplex Ftth

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Samsung Galaxy Book Odyssey
    CPU
    Intel Core Intel i7-11600H
    Memory
    32GB DDR4 3200Mhz
    Graphics Card(s)
    Nvidia RTX 3050 Ti
    Screen Resolution
    Full HD
    Hard Drives
    Samsung 990PRO
Hey, folks,

Thanks to a lot of wonderful folks here, we've made mention in a previous Insider topic about cleanup steps that can be run after Windows Update performs a major version install.

Though these have been mentioned before by many, many people, it was this post by @IanMosley that started me on implementing this as an step to clean up both my main Windows installation and all the VMs I have for testing:


A few posts later, @geneo offered some good advice on how to streamline that set of commands in this post:


Which, eventually, led me to mentioning that I had put them all in a batch file to run after major WU installs:


Thus far I've just been right clicking the file and selecting Run as Administrator to run it - not all that hard. But, today, I went in search of a self-elevation script for batch files so I can just double click the file and let it do its thing.

I found a good thread at Stack Overflow that has a few methods mentioned, including direct self-elevation, elevation via WSH, via VBScripting, and even via Powershell. I tested several ones, and found that this particular script works best and is no nonsense and has no fuss:


I've also added a pause command at the end so that the window remains on screen after completing so you can see the results, and a simple keypress will close it out.

So, here is the code as I'm using it now:

Batch:
:: Elevation script from StackOverflow
:: https://stackoverflow.com/a/28467343

:: Begin Elevation script

@ECHO OFF
setlocal EnableDelayedExpansion

::net file to test privileges, 1>NUL redirects output, 2>NUL redirects errors
NET FILE 1>NUL 2>NUL
if '%errorlevel%' == '0' ( goto START ) else ( goto getPrivileges )

:getPrivileges
if '%1'=='ELEV' ( goto START )

set "batchPath=%~f0"
set "batchArgs=ELEV"

::Add quotes to the batch path, if needed
set "script=%0"
set script=%script:"=%
IF '%0'=='!script!' ( GOTO PathQuotesDone )
    set "batchPath=""%batchPath%"""
:PathQuotesDone

::Add quotes to the arguments, if needed.
:ArgLoop
IF '%1'=='' ( GOTO EndArgLoop ) else ( GOTO AddArg )
    :AddArg
    set "arg=%1"
    set arg=%arg:"=%
    IF '%1'=='!arg!' ( GOTO NoQuotes )
        set "batchArgs=%batchArgs% "%1""
        GOTO QuotesDone
        :NoQuotes
        set "batchArgs=%batchArgs% %1"
    :QuotesDone
    shift
    GOTO ArgLoop
:EndArgLoop

::Create and run the vb script to elevate the batch file
ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
ECHO UAC.ShellExecute "cmd", "/c ""!batchPath! !batchArgs!""", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
"%temp%\OEgetPrivileges.vbs"
exit /B

:START
::Remove the elevation tag and set the correct working directory
IF '%1'=='ELEV' ( shift /1 )
cd /d %~dp0

::Do your adminy thing here...

:: End Elevation Script
:: Begin cleanup script

start /B /wait rundll32.exe pnpclean.dll,RunDLL_PnpClean /drivers/maxclean
start /B /wait dism /Online /Cleanup-Image /CheckHealth
start /B /wait sfc /scannow
start /B /wait dism /Online /Cleanup-Image /RestoreHealth
start /B /wait dism /online /Cleanup-Image /Startcomponentcleanup /resetbase

pause

You can copy the contents and save it to a file with a .BAT extension and it should work just fine, tested across Windows 10 and Windows 10 Insider Preview, plus Windows 11 (RTM, Release Preview, Beta, Dev and Canary current builds).

If you'd rather just download the batch file, here you go.

Download

Enjoy!

P.S. - if you have any suggestions on improving it / adding more functionality / expanding the scope of the cleanup, feel free to comment below!
@johnlgalt, as someone who's not familiar with batch files, I'm a little confused. Well, a lot confused!

Will the download button give me everything I should have, or am I supposed to grab the individual batch files?
 

My Computers

System One System Two

  • OS
    Windows 11 23H2 22631.2861
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Envy TE01-1xxx
    CPU
    Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz 2.90 GHz
    Motherboard
    16.0GB Dual-Channel Unknown @ 1463MHz (21-21-21-47)
    Memory
    16384 MBytes
    Graphics Card(s)
    Intel UHD Graphics 630
    Sound Card
    Realtek High Definition Audio
    Monitor(s) Displays
    Monitor 1 - Acer 27" Monitor 2 - Acer 27"
    Screen Resolution
    1920 x 1080
    Hard Drives
    WDC PC SN530 SDBPNPZ-512G-1006 (SSD)
    Seagate ST1000DM003-1SB102
    Seagate BUP Slim SCSI Disk Device (SSD)
    PSU
    HP
    Case
    HP
    Cooling
    Standard
    Keyboard
    Logitech Wave K350
    Mouse
    Logitech M705
    Internet Speed
    500 mbps
    Browser
    Firefox
    Antivirus
    Windows Defender
    Other Info
    That's all Folks!
  • Operating System
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP
    CPU
    Intel Core i7 (10th gen) 10700
    Motherboard
    Intel
    Memory
    16 GB
    Graphics card(s)
    Intel UHD Graphics 630
    Sound Card
    Built-in
    Monitor(s) Displays
    Acer 27" & Samsung 24"
    Screen Resolution
    1920 x
    Hard Drives
    SSD (512 GB)
    HDD (1 TB)
    Seagate
    PSU
    Intel i7 10th Generation
    Case
    HP
    Cooling
    HP/Intel?
    Mouse
    Logitech M705
    Keyboard
    Logitech Wave K350
    Internet Speed
    50 mbps
    Browser
    Firefox 90.2
    Antivirus
    Windows Defender
    Other Info
    Headphone/Microphone Combo
    SuperSpeed USB Type-A (4 on front)
    HP 3-in-One Card Readr
    SuperSpeed USB Type-C
    DVD Writer
Will the download button give me everything I should have
It'll just provide you with the .bat file mentioned in the original post. Most of that .bat script is for running with elevated privielges, really the script just runs these standard commands:

Code:
start /B /wait rundll32.exe pnpclean.dll,RunDLL_PnpClean /drivers/maxclean
start /B /wait dism /Online /Cleanup-Image /CheckHealth
start /B /wait sfc /scannow
start /B /wait dism /Online /Cleanup-Image /RestoreHealth
start /B /wait dism /online /Cleanup-Image /Startcomponentcleanup /resetbase

Warning:

Code:
DISM /Online /Cleanup-Image /StartComponentCleanup /ResetBase

Just a little warning about the /ResetBase switch and to explain what it actually does because the post being referred to doesn't really explain it:

If you make regular backups like I do, you can also run:

dism /online /Cleanup-Image /Startcomponentcleanup /resetbase

This will reduce the storage your Windows takes cleaning out cruft not need for the release or restoring. I do this to reduce my backup size.
The /ResetBase switch "merges" the VersionedIndex subkeys together along with the associated ComponentFamilies subkeys which is part of the COMPONENTS hive. The switch essentially makes it so that all your components are being "serviced" by that one particular version. This means that if you try to remove an update manually then you may get an error message stating that the update can't be removed.

The /StartComponentCleanup switch is what removes unused components and packages from your WinSxS folder. This cleanup is automatically ran around every 30 days by Windows.

Code:
start /B /wait rundll32.exe pnpclean.dll,RunDLL_PnpClean /drivers/maxclean

Not sure how safe this is? It seems to be an undocumented .dll which probably shouldn't be run without a prior backup.
 

My Computer

System One

  • OS
    Windows 11, Windows 10, Linux Fedora Cinnamon
I downloaded your script, but at this line in the script, dism /online /Cleanup-Image /Startcomponentcleanup /resetbase, I get this error at 23%:
Error: 6824 - The operation cannot be performed because another transaction depends on this property not changing.
What to do??
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Homebuild
    CPU
    Core i5 14600K
    Motherboard
    ASUS PRIME z790-A WiFi
    Memory
    Corsair Vengeance DDR5-5600 - 32GB - CL36
    Graphics Card(s)
    MSI RTX 3090 GamerX Trio
    Sound Card
    SoundBlaster AE5
    Monitor(s) Displays
    ASUS ROG PG32UQ
    Screen Resolution
    3840x2160p
    Hard Drives
    Samsung 970 EVO NVMe 500Gbyte
    Adata XPG GAMMIX S11 Pro 1Tbyte
    Adata XPG GAMMIX S11 Pro 2Tbyte
    Hitachi 8Tbyte HDD
    PSU
    RIOTORO Enigma G2 PSU 850W 80+ Gold FM
    Case
    Fractal R5 Black Edition
    Cooling
    Noctua NH15D
    Keyboard
    Logitech G915 LightSpeed
    Mouse
    Logitecg G900 LightSpeed
    Internet Speed
    1000/1000
    Browser
    Chrome
    Antivirus
    BitDefender
    Other Info
    Mostly build for gaming.
Error: 6824 - The operation cannot be performed because another transaction depends on this property not changing.
What to do??
Have you checked the DISM.log? Why are you running with /ResetBase? There is almost no reason to do so unless you understand what it actually does.
 

My Computer

System One

  • OS
    Windows 11, Windows 10, Linux Fedora Cinnamon
The cmdline I wrote in the previous post is a line from the downloaded script in this thread. I don't run the command seperatly, but it is this line that gives the error, when I run the script.
The DISM-log shows this about DISM (see attached file)
Image version 10.0.22635.3350 it writes when running the script.
 

Attachments

  • DISM.2024-03-26 145157.zip
    2.6 KB · Views: 2

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Homebuild
    CPU
    Core i5 14600K
    Motherboard
    ASUS PRIME z790-A WiFi
    Memory
    Corsair Vengeance DDR5-5600 - 32GB - CL36
    Graphics Card(s)
    MSI RTX 3090 GamerX Trio
    Sound Card
    SoundBlaster AE5
    Monitor(s) Displays
    ASUS ROG PG32UQ
    Screen Resolution
    3840x2160p
    Hard Drives
    Samsung 970 EVO NVMe 500Gbyte
    Adata XPG GAMMIX S11 Pro 1Tbyte
    Adata XPG GAMMIX S11 Pro 2Tbyte
    Hitachi 8Tbyte HDD
    PSU
    RIOTORO Enigma G2 PSU 850W 80+ Gold FM
    Case
    Fractal R5 Black Edition
    Cooling
    Noctua NH15D
    Keyboard
    Logitech G915 LightSpeed
    Mouse
    Logitecg G900 LightSpeed
    Internet Speed
    1000/1000
    Browser
    Chrome
    Antivirus
    BitDefender
    Other Info
    Mostly build for gaming.
I downloaded your script, but at this line in the script, dism /online /Cleanup-Image /Startcomponentcleanup /resetbase, I get this error at 23%:
Error: 6824 - The operation cannot be performed because another transaction depends on this property not changing.
What to do??
Did you run the script as Admin? I just ran the script and it finished without any problems.
 

My Computers

System One System Two

  • OS
    Windows 11 Canary Channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    PowerSpec B746
    CPU
    Intel Core i7-10700K
    Motherboard
    ASRock Z490 Phantom Gaming 4/ax
    Memory
    16GB (8GB PC4-19200 DDR4 SDRAM x2)
    Graphics Card(s)
    NVIDIA GeForce GTX 1050 TI
    Sound Card
    Realtek Audio
    Monitor(s) Displays
    Samsung SAM0A87 Samsung SAM0D32
    Screen Resolution
    1920 x 1080
    Hard Drives
    NVMe WDC WDS100T2B0C-00PXH0 1TB
    Samsung SSD 860 EVO 1TB
    PSU
    750 Watts (62.5A)
    Case
    PowerSpec/Lian Li ATX 205
    Keyboard
    Logitech K270
    Mouse
    Logitech M185
    Browser
    Microsoft Edge and Firefox
    Antivirus
    ESET Internet Security
  • Operating System
    Windows 11 Canary Channel
    Computer type
    PC/Desktop
    Manufacturer/Model
    PowerSpec G156
    CPU
    Intel Core i5-8400 CPU @ 2.80GHz
    Motherboard
    AsusTeK Prime B360M-S
    Memory
    16 MB DDR 4-2666
    Monitor(s) Displays
    23" Speptre HDMI 75Hz
    Screen Resolution
    1920x1080
    Hard Drives
    Samsung 970 EVO 500GB NVMe
    Mouse
    Logitek M185
    Keyboard
    Logitek K270
    Browser
    Firefox, Edge and Edge Canary
    Antivirus
    Windows Defender

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Homebuild
    CPU
    Core i5 14600K
    Motherboard
    ASUS PRIME z790-A WiFi
    Memory
    Corsair Vengeance DDR5-5600 - 32GB - CL36
    Graphics Card(s)
    MSI RTX 3090 GamerX Trio
    Sound Card
    SoundBlaster AE5
    Monitor(s) Displays
    ASUS ROG PG32UQ
    Screen Resolution
    3840x2160p
    Hard Drives
    Samsung 970 EVO NVMe 500Gbyte
    Adata XPG GAMMIX S11 Pro 1Tbyte
    Adata XPG GAMMIX S11 Pro 2Tbyte
    Hitachi 8Tbyte HDD
    PSU
    RIOTORO Enigma G2 PSU 850W 80+ Gold FM
    Case
    Fractal R5 Black Edition
    Cooling
    Noctua NH15D
    Keyboard
    Logitech G915 LightSpeed
    Mouse
    Logitecg G900 LightSpeed
    Internet Speed
    1000/1000
    Browser
    Chrome
    Antivirus
    BitDefender
    Other Info
    Mostly build for gaming.
The DISM-log shows this about DISM (see attached file)
Thanks, it appears that the DISM.log doesn't reveal much more than what you've already mentioned. Could you please provide all the files from the following directory:

Code:
%systemroot%\Logs\CBS

DISM.log excerpt:

Code:
2024-03-26 14:59:48, Info                  DISM   DISM.EXE: Executing command line: dism  /online /Cleanup-Image /Startcomponentcleanup /resetbase
2024-03-26 14:59:48, Info                  DISM   DISM Manager: PID=14668 TID=17996 physical location path: C:\ - CDISMManager::CreateImageSession
2024-03-26 14:59:48, Info                  DISM   DISM Manager: PID=14668 TID=17996 Event name for current DISM session is Global\{E63C4D50-D671-48EE-A714-D68F1C42D8AE} - CDISMManager::CheckSessionAndLock
2024-03-26 14:59:48, Info                  DISM   DISM Manager: PID=14668 TID=17996 Create session event 0x25c for current DISM session and event name is Global\{E63C4D50-D671-48EE-A714-D68F1C42D8AE}  - CDISMManager::CheckSessionAndLock
2024-03-26 14:59:48, Info                  DISM   DISM Manager: PID=14668 TID=17996 Copying DISM from "C:\Windows\System32\Dism" - CDISMManager::CreateImageSessionFromLocation
2024-03-26 14:59:48, Info                  DISM   DISM Manager: PID=14668 TID=17996 No Sandbox was created, DISM running in-place. - CDISMManager::CreateImageSessionFromLocation
2024-03-26 14:59:48, Info                  DISM   DISM Manager: PID=14668 TID=17996 Successfully loaded the ImageSession at "C:\Windows\System32\Dism" - CDISMManager::LoadRemoteImageSession
2024-03-26 14:59:48, Info                  DISM   DISM Image Session: PID=22076 TID=8024 Instantiating the Provider Store. - CDISMImageSession::get_ProviderStore
2024-03-26 14:59:48, Info                  DISM   DISM OS Provider: PID=22076 TID=8024 Defaulting SystemPath to C:\ - CDISMOSServiceManager::Final_OnConnect
2024-03-26 14:59:48, Info                  DISM   DISM OS Provider: PID=22076 TID=8024 Defaulting Windows folder to C:\Windows - CDISMOSServiceManager::Final_OnConnect
2024-03-26 14:59:48, Info                  DISM   DISM Provider Store: PID=22076 TID=8024 Attempting to initialize the logger from the Image Session. - CDISMProviderStore::Final_OnConnect
2024-03-26 14:59:48, Info                  DISM   Initialized Panther logging at C:\Windows\Logs\DISM\dism.log
2024-03-26 14:59:48, Info                  DISM   DISM Provider Store: PID=22076 TID=8024 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger
2024-03-26 14:59:48, Info                  DISM   Initialized Panther logging at C:\Windows\Logs\DISM\dism.log
2024-03-26 14:59:48, Info                  DISM   Initialized Panther logging at C:\Windows\Logs\DISM\dism.log
2024-03-26 14:59:48, Info                  DISM   DISM Manager: PID=14668 TID=17996 Image session successfully loaded from location: C:\Windows\System32\Dism - CDISMManager::CreateImageSession
2024-03-26 14:59:48, Info                  DISM   DISM.EXE: Target image information: OS Version=10.0.22635.3350, Image architecture=amd64
2024-03-26 14:59:48, Info                  DISM   DISM.EXE: Image session version: 10.0.22621.1
2024-03-26 14:59:48, Info                  DISM   DISM Transmog Provider: PID=22076 TID=8024 Current image session is [ONLINE] - CTransmogManager::GetMode
2024-03-26 14:59:48, Info                  DISM   DISM Transmog Provider: PID=22076 TID=8024 Audit Mode: [No] - CTransmogManager::Initialize
2024-03-26 14:59:48, Info                  DISM   DISM Transmog Provider: PID=22076 TID=8024 GetProductType: ProductType = [WinNT] - CTransmogManager::GetProductType
2024-03-26 14:59:48, Info                  DISM   DISM Transmog Provider: PID=22076 TID=8024 Product Type: [WinNT] - CTransmogManager::Initialize
2024-03-26 14:59:48, Info                  DISM   DISM Transmog Provider: PID=22076 TID=8024 Product Type ServerNT : [No] - CTransmogManager::Initialize
2024-03-26 14:59:48, Info                  CSI    00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.22621.3350_none_e954f2c042d4ac97\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND
2024-03-26 14:59:48, Info                  CSI    00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.22621.3350_none_e954f2c042d4ac97\wcp.dll' : got STATUS_SUCCESS
2024-03-26 14:59:48, Info                  DISM   DISM Driver Manager: PID=22076 TID=8024 Further logs for driver related operations can be found in the target operating system at %WINDIR%\inf\setupapi.offline.log - CDriverManager::Initialize
2024-03-26 14:59:48, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 Finished initializing the CbsConUI Handler. - CCbsConUIHandler::Initialize
2024-03-26 14:59:48, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 CBS is being initialized for online use. More information about CBS actions can be located at: %windir%\logs\CBS\CBS.log - CDISMPackageManager::Initialize
2024-03-26 14:59:48, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 Loaded servicing stack for online use. - CDISMPackageManager::CreateCbsSession
2024-03-26 14:59:48, Info                  CSI    00000001 Shim considered [l:126]'\??\C:\Windows\Servicing\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.22621.3350_none_e954f2c042d4ac97\wcp.dll' : got STATUS_OBJECT_PATH_NOT_FOUND
2024-03-26 14:59:48, Info                  CSI    00000002 Shim considered [l:123]'\??\C:\Windows\WinSxS\amd64_microsoft-windows-servicingstack_31bf3856ad364e35_10.0.22621.3350_none_e954f2c042d4ac97\wcp.dll' : got STATUS_SUCCESS
2024-03-26 14:59:48, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 Processing the top level command token(cleanup-image). - CPackageManagerCLIHandler::Private_ValidateCmdLine
2024-03-26 14:59:48, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 Attempting to route to appropriate command handler. - CPackageManagerCLIHandler::ExecuteCmdLine
2024-03-26 14:59:48, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 Routing the command... - CPackageManagerCLIHandler::ExecuteCmdLine
2024-03-26 14:59:48, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 CBS session options=0x10400100! - CDISMPackageManager::Internal_Finalize
2024-03-26 15:01:32, Info                  DISM   DISM Package Manager: PID=22076 TID=7332  Error in operation: (null) (CBS HRESULT=0x80071aa8) - CCbsConUIHandler::Error
2024-03-26 15:01:32, Error                 DISM   DISM Package Manager: PID=22076 TID=8024 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x80071aa8)
2024-03-26 15:01:32, Error                 DISM   DISM Package Manager: PID=22076 TID=8024 Failed processing package changes - CDISMPackageManager::StartComponentCleanupEx(hr:0x80071aa8)
2024-03-26 15:01:32, Error                 DISM   DISM Package Manager: PID=22076 TID=8024 Failed to start component cleanup. - CPackageManagerCLIHandler::ProcessCmdLine_CleanupImage(hr:0x80071aa8)
2024-03-26 15:01:32, Error                 DISM   DISM Package Manager: PID=22076 TID=8024 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x80071aa8)
2024-03-26 15:01:32, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 Further logs for online package and feature related operations can be found at %WINDIR%\logs\CBS\cbs.log - CPackageManagerCLIHandler::ExecuteCmdLine
2024-03-26 15:01:32, Error                 DISM   DISM.EXE: DISM Package Manager processed the command line but failed. HRESULT=80071AA8
 

My Computer

System One

  • OS
    Windows 11, Windows 10, Linux Fedora Cinnamon
Image version 10.0.22635.3350 it writes when running the script.

Rich (BB code):
2024-03-26 15:01:32, Error                 DISM   DISM Package Manager: PID=22076 TID=8024 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x80071aa8)
2024-03-26 15:01:32, Error                 DISM   DISM Package Manager: PID=22076 TID=8024 Failed processing package changes - CDISMPackageManager::StartComponentCleanupEx(hr:0x80071aa8)
2024-03-26 15:01:32, Error                 DISM   DISM Package Manager: PID=22076 TID=8024 Failed to start component cleanup. - CPackageManagerCLIHandler::ProcessCmdLine_CleanupImage(hr:0x80071aa8)
2024-03-26 15:01:32, Error                 DISM   DISM Package Manager: PID=22076 TID=8024 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x80071aa8)
2024-03-26 15:01:32, Info                  DISM   DISM Package Manager: PID=22076 TID=8024 Further logs for online package and feature related operations can be found at %WINDIR%\logs\CBS\cbs.log - CPackageManagerCLIHandler::ExecuteCmdLine

You are running an Insider Preview build (beta channel), such releases may contain bugs - and as explained by @x BlueRobot there is no need to run DISM with the /ResetBase switch. And more importantly do not run such scripts when a pending restart is set, or if other updates are queued to be installed.
 

My Computer

System One

  • OS
    Windows 10
I have done ALL that the scriptcreator has written about it, and I don't know how to change the script, or the parameters inside the script. NO pending restart is active, and windows is fully updated ie WU.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Homebuild
    CPU
    Core i5 14600K
    Motherboard
    ASUS PRIME z790-A WiFi
    Memory
    Corsair Vengeance DDR5-5600 - 32GB - CL36
    Graphics Card(s)
    MSI RTX 3090 GamerX Trio
    Sound Card
    SoundBlaster AE5
    Monitor(s) Displays
    ASUS ROG PG32UQ
    Screen Resolution
    3840x2160p
    Hard Drives
    Samsung 970 EVO NVMe 500Gbyte
    Adata XPG GAMMIX S11 Pro 1Tbyte
    Adata XPG GAMMIX S11 Pro 2Tbyte
    Hitachi 8Tbyte HDD
    PSU
    RIOTORO Enigma G2 PSU 850W 80+ Gold FM
    Case
    Fractal R5 Black Edition
    Cooling
    Noctua NH15D
    Keyboard
    Logitech G915 LightSpeed
    Mouse
    Logitecg G900 LightSpeed
    Internet Speed
    1000/1000
    Browser
    Chrome
    Antivirus
    BitDefender
    Other Info
    Mostly build for gaming.

Latest Support Threads

Back
Top Bottom