看代码前先看这个贴子http://bbs.bathome.net/viewthread.php?tid=573
- @echo off
- :Query1
- for /f "delims=" %%i in ('devcon.exe find USB\Class_E0') do if not defined var set "var=%%i"
- if /i "%var%"=="No matching devices found." goto Query2
- echo."%var%"|find /i "Wireless">nul&&(goto Yes)
- goto No
-
- :Query2
- set var=
- for /f "delims=" %%i in ('devcon.exe find USB\Class_FF') do if not defined var set "var=%%i"
- if /i "%var%"=="No matching devices found." goto No
- echo."%var%"|find /i "Wireless">nul&&(goto Yes)
- goto No
-
- :Yes
- for /f "tokens=1" %%i in ("%var%") do set "ID=%%i"
- echo 发现无线网卡,设备ID "%ID%"
- pause&exit
-
- :No
- echo 没发现无线网卡
- pause&exit
复制代码
如有必要|find /i "Wireless">nul&&(goto Yes) 改成"|findstr /i "Wireless Mbps">nul&&(goto Yes) |