嘻嘻,俺是个菜鸟,正好刚才也用到类似功能,就用了一个笨办法写了一些。基本能用。呵呵!不过方法比较笨,用到的知识也很单调,希望对你能有启发。欢迎大侠们指点啊。
@echo off
type d:\1.txt | find /I "username:" > %temp%\tmp1.tmp
for /F %%i in ('type %temp%\tmp1.tmp') do set aaa=%%i
set uname=%aaa:~9,20%
echo %uname%
type d:\1.txt | find /I "passwd:" > %temp%\tmp2.tmp
for /F %%i in ('type %temp%\tmp2.tmp') do set bbb=%%i
set passwd=%bbb:~7,20%
echo %passwd%
type d:\1.txt | find /I "IPadd:" > %temp%\tmp3.tmp
for /F %%i in ('type %temp%\tmp3.tmp') do set ccc=%%i
set ipadd=%ccc:~6,22%
echo %ipadd%
del %temp%\tmp1.tmp
del %temp%\tmp2.tmp
del %temp%\tmp3.tmp