Skip to content

Instantly share code, notes, and snippets.

@joshschmelzle
Last active May 23, 2018 19:13
Show Gist options
  • Save joshschmelzle/96ebff31286512a775d433f3fb8e8898 to your computer and use it in GitHub Desktop.
Save joshschmelzle/96ebff31286512a775d433f3fb8e8898 to your computer and use it in GitHub Desktop.
Modified Wi-Fi batch file. Originally created by Tom Carpenter
@ECHO OFF
if [%1]==[] GOTO MENU
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==help GOTO HELP
if /I %1==menu GOTO MENU
if /I %1==profiles GOTO PROFILES
netsh wlan show interfaces %1
GOTO END
:NETWORKS
netsh wlan show networks mode=bssid 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
:PROFILES
netsh wlan show profiles
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 B = Show wireless networks in BSSID mode on default interface
ECHO N = Show wireless networks on default interface
ECHO D = Show drivers on default interface
ECHO P = Show wireless profiles on machine
ECHO C = Show wireless capabilities of machine
ECHO H = Show help for this script
ECHO.
choice /C:ISBNDPCH /M "Please press 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 MODE=BSSID
if %errorlevel%==4 NETSH WLAN SHOW NETWORKS
if %errorlevel%==5 NETSH WLAN SHOW DRIVERS
if %errorlevel%==6 NETSH WLAN SHOW PROFILES
if %errorlevel%==7 NETSH WLAN SHOW WIRELESSCAPABILITIES
if %errorlevel%==8 GOTO HELP
GOTO END
:HELP
ECHO.
ECHO NETSH WLAN Interface Script
ECHO.
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:
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 only the wireless networks seen by that
ECHO interface.
ECHO.
:END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment