本帖最后由 lovekix 于 2021-6-17 13:30 编辑
回复 18# went - @echo off
- cd /d "C:\Windows\servicing\Packages"
- set "skip=0"
- for /f "delims=:" %%i in ('findstr /b /n ":list" "%~0"') do set "skip=%%i"
- for /f "usebackq skip=%skip% delims=" %%i in ("%~0") do call set "save=%%save%%:%%i"
- for /f "delims=" %%i in ('dir /b /a-d ^| findstr /b /v "%save::= %"') do del %%i
- pause&exit
- REM 开头保存字符串,一行一个
- :list
- Microsoft-Windows-2
- Package
- Microsoft-Windows-Branding
复制代码 感谢 went 完美解决
把 源码发出来 备份 防止丢失 |