第1页共23页编号:时间:2021年x月x日书山有路勤为径,学海无涯苦作舟页码:第1页共23页网络故障诊断代码及诊断原理由于错误之处在所难免,而文档又不能自行修改,所以给出代码更新地址讨论地址:http://www
cn-dos
net/forum/viewthread
tid=51117&fpage=1一、诊断代码@echooff&setlocalenabledelayedexpansiontitle%~n0
codebyrs+2010
3set/alast_flag=1::首先判断物理连接是否正常
echo[零]判断物理连接是否正常
ipconfig/all2>nul|find/i"Mediadisconnected">nul2>nul&&(echo
&echo请检查物理连接
&pause>nul)||(echo----ok
)::启动本地连接或重启本地连接echo
&echo[一]启动本地连接中
setnum=0for/f"tokens=2delims=\"%%kin('devconlistclassnet^|find/i"net"')do(if
equ0setdeviceinfo=%%kset/anum+=1)setnum1=0for/L%%jin(0,1,22)do(if
LSS2(setdevicevar=
deviceinfo
setstr=
devicevar:~0,1
setdevicevar=
devicevar:~1
"=="&"(set/anum1+=1)set/atotal+=1))set/atotal=
-1setdeviceinfo=
deviceinfo:~0,17
devconstatuspci\
deviceinfo
*|find/i"disa