试试,
for /F %%i in ('Type "%~dp0Windows\Remove.TXT" 2^>nul') do (
set a=%%i
for /F "tokens=2 delims=: " %%a in ('call dism /online /get-features ^| Findstr /I /C:"FeatureName : %%a%%"') do
详情回复
发表于 2023-7-12 11:19
for /F %%i in ('Type "%~dp0Windows\Remove.TXT" 2^>nul') do (
set a=%%i
for /F "tokens=2 delims=: " %%a in ('call dism /online /get-features ^| Findstr /I /C:"FeatureName : %%a%%"') do if "%%a" NEQ "" Dism /online /Disable-Feature /FeatureName:%%a >nul
)