w10install/wim/remove-packages.cmd

38 lines
964 B
Batchfile
Raw Normal View History

2021-01-19 22:59:40 +01:00
@echo off
set IMAGE=c:\TEMP\IMAGE
2021-03-04 10:52:52 +01:00
rem the CHECKFILE is a file that will be monitored against deletion ...
set CHECKFILE=%IMAGE%\Windows\SysWOW64\mf.dll
2021-01-19 22:59:40 +01:00
echo exporting PACKAGE list BEFORE doing any changes ...
install_wim_tweak /p %IMAGE% /l
2021-01-19 22:59:40 +01:00
move /Y Packages.txt Packages-BEFORE.txt
2021-01-20 13:00:14 +01:00
rem ###################################
rem MAIN loop ( remove packages ) ...
rem ###################################
2021-03-16 23:55:01 +01:00
FOR /F %%P in (packages-to-remove.csv) do (
2021-01-19 22:59:40 +01:00
echo removing PACKAGE [ %%P ] ...
install_wim_tweak.exe /p %IMAGE% /c "%%P" /r /n
2021-01-19 22:59:40 +01:00
2021-03-04 10:52:52 +01:00
rem we will exit here in case the checkfile was deleted by a package removal ...
2021-01-19 22:59:40 +01:00
if NOT EXIST %CHECKFILE% (
echo ERROR: File %CHECKFILE% was deleted
exit /b
)
)
echo CLEANUP ...
del /F SOFTWAREBKP 1>nul 2>nul
echo exporting remaining PACKAGES list ...
install_wim_tweak /p %IMAGE% /l
2021-01-19 22:59:40 +01:00
move /Y Packages.txt Packages-AFTER.txt
rem showing package files ...
2021-01-19 22:59:40 +01:00
dir Packages*.txt
2021-03-04 10:52:52 +01:00