@echo off
for /F %%I in ('echo tftp') do (
for /F "tokens=2 delims=: " %%a in ('dism /online /get-features^|Find /i ": %%I"') do if /i "%%a"=="%%I" @echo Dism /online /Disable-Feature /FeatureName:%%a
)
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 ^| Find /i "FeatureName : %%a%%"') do if "%%a" NEQ "" Dism /online /Disable-Feature /FeatureName:%%a >nul
)
你自己检查一下啊,CMD中的空格bug,
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 ^| Find / i "Fe
详情回复
发表于 2023-7-12 20:31
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
)