Throwback: Install Windows Update .cab files recursively with cmd script

Nathan Blasac
Nathan Blasac - Notes from the Field
1 min readOct 8, 2021

--

Long story short, I needed to recursively install all Windows Updates, within a directory tree silently. These are .cab files. They are structured as below:

Directory Structure

Credit to original script thread I repurposed. I also know there are fancier PowerShell ways to do this. I needed something quick and dirty:

@echo offcd /d "%~dp0"
for /f "delims=" %%f in ('dir /s /b *.cab ') do dism.exe /Add-Package /Online /norestart /PackagePath:"%%f"

I used a task sequence to run the .cmd file, reboot in between, and run it twice for good measure. As below:

I also have an ADR running that populates the latest patches in the directory on a schedule.

Until next time.

--

--

Consultant working mainly on System Center, Azure/EMS, Systems Management and Windows Deployment.