首先,运行这个批处理:
@echo off
for /f "tokens=15" %%i in (' ipconfig ^| find "IP Address" ') do >hanye.txt echo %%ihanye
在hanye.txt里的ip 地址后面与hanye之间的就是回车符,复制“回车符”和后面的hanye,然后在ht.txt文本里,每个ip的后面粘贴。
当然,你也可以通过edit获得回车符:ctrl+p切换进入,ctrl+m获得的就是回车符
批处理还用原来的:
@echo off
for /f "tokens=15" %%i in (' ipconfig ^| find "IP Address" ') do for /f %%j in (c:\ht.txt) do (
echo i= %%ihanye
echo j= %%j
if "%%ihanye" == "%%j" (echo yes+++++++++++) else echo no----------
)
pause
goto 的时候,还是在原批处理中,所以不存在带不带着,因为变量本来就都在。。。
Last edited by Hanyeguxing on 2009-9-7 at 07:54 ]