- @echo off
- for /f "tokens=*" %%i in ('findstr /i /c:"Client=" a.txt') do (
- set "str=%%i"&setlocal enabledelayedexpansion
- set str=!str:"=!
- if not "!str:~,1!"=="#" for %%a in (!str!) do (
- if defined flag1 set H=%%a
- if defined flag2 set/p=%%a <nul&set flag=1
- if defined flag if defined H echo !H!&set H=
- if "%%a"=="-H" (set flag1=1) else set flag1=
- if "%%a"=="-h" (set flag2=1) else set flag2=
- )
- endlocal
- )
复制代码
|