@echo off set IMAGE=c:\TEMP\IMAGE FOR /F %%P in (packages-to-remove.csv) do ( echo removing package [ %%P ] dism /Image:%IMAGE% /Remove-Package /PackageName:"%%P" )