w10install/wim/remove-packages.cmd

20 lines
450 B
Batchfile
Raw Normal View History

2022-12-27 17:15:05 +01:00
@echo off
set IMAGE=c:\TEMP\IMAGE
echo exporting PACKAGES list BEFORE doing any changes ...
dism /Image:%IMAGE% /Get-Packages 1>Packages-BEFORE.txt
FOR /F %%P in (packages-to-remove.csv) do (
echo removing package [ %%P ]
dism /Image:%IMAGE% /Remove-Package /PackageName:"%%P"
)
echo exporting remaining PACKAGES list ...
dism /Image:%IMAGE% /Get-Packages 1>Packages-AFTER.txt
rem showing packages ...
dir Packages*.txt