联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off for /f "tokens=1,2" %%i in ('netstat -an -p TCP^|find "80"') do @echo %%j pause
@echo off for /f "tokens=1,2" %%i in ('netstat -an -p TCP^|find ":80"') do @echo %%j pause
Set Ws=CreateObject("WScript.Shell") Set oExec=ws.Exec("%comspec% /c netstat -an -p TCP") s=oExec.StdOut.ReadAll wscript.echo re(s) function re(a) set regex=new regexp regex.pattern=":[1-9][\d]{1,4}" regex.global=true set matchs=regex.execute(a) for each match in matchs m=replace(match,":","") if instr(re,m)=0 then re=re & m & vbcrlf end if next end function
@echo off for /f "tokens=1-2 delims= " %%a in ('netstat -an -p TCP') do ( if defined flag set "ip=%%b"&set "flag=" if /i "%%b %%c"=="Local Address" set flag=a ) echo %ip% pause