Simple Wi-Fi NETSH Batch File for Information Gathering

Here is a simple batch file that will get information from NETSH without the lengthy commands. No error checking. A little help. But it’s the one I use. I added a menu for those who want interactive use. Copy and past it into a file with a .bat extension and you’re good to go. I name mine wifi.bat.  Someone asked for it so I thought I’d share it with the world.

Just run wifi.bat with no params to get help. Run “wifi.bat menu” to see the interactive menu I built just for you!

Have fun, tweak and change all you like.

@ECHO OFF
if [%1]==[] GOTO HELP

if /I %1==interfaces GOTO SHOWALL

if /I %1==networks GOTO NETWORKS

if /I %1==drivers GOTO DRIVERS

if /I %1==settings GOTO SETTINGS

if /I %1==menu GOTO MENU

netsh wlan show interfaces %1
GOTO END

:NETWORKS
netsh wlan show networks interface=%2
GOTO END

:DRIVERS
netsh wlan show drivers interface=%2
GOTO END

:SETTINGS
netsh wlan show settings
GOTO END

:SHOWALL
netsh wlan show interfaces
GOTO END

:MENU
CLS
ECHO.
ECHO Choose from the following options:
ECHO.
ECHO  I = Show all wireless interfaces
ECHO  S = Show general wireless settings
ECHO  N = Show wireless networks on default interface
ECHO  D = Show drivers on default interface
ECHO.
choice /C ISND /M "Make your selection: "
ECHO %errorlevel%
if %errorlevel%==1 NETSH WLAN SHOW INTERFACES
if %errorlevel%==2 NETSH WLAN SHOW SETTINGS
if %errorlevel%==3 NETSH WLAN SHOW NETWORKS
if %errorlevel%==4 NETSH WLAN SHOW DRIVERS

GOTO END

:HELP
ECHO.
ECHO NETSH Speedy Interface Script
ECHO This command provides information about Wi-Fi
ECHO interfaces. The proper use is:
ECHO.
ECHO wifi interface_name
ECHO.
ECHO interface_name should be in quotation marks if
ECHO the name has one or more spaces. For example:
ECHO.
ECHO wifi "Wi-Fi 1"
ECHO.
ECHO When interface names are not known, use the
ECHO modifier interfaces without an interface name.
ECHO.
ECHO Other modifier commands may be used to show other
ECHO information. Such commands should precede the
ECHO interface_name parameter. Only one modifier'
ECHO command may be used at a time.
ECHO.
ECHO Possible modifier commands include:
ECHO.
ECHO networks - show networks
ECHO drivers - show drivers
ECHO settings - show general settings
ECHO menu - use an interactive menu
ECHO.
ECHO For example:
ECHO.
ECHO  wifi networks "Wi-Fi 1"
ECHO.
ECHO would show the wireless networks seen by that
ECHO interface.
ECHO.
ECHO Created by Tom Carpenter, 2016
ECHO.
:END

2 thoughts on “Simple Wi-Fi NETSH Batch File for Information Gathering”

Leave a Reply